Question

In: Electrical Engineering

Design Task 2: One Second Prescalar In many systems it is desirable to have a very...

Design Task 2: One Second Prescalar In many systems it is desirable to have a very fast system clock to clock most of the sequential entities in the system. However, there may be other sequential entities in the same system that need to be clocked at a much slower speed. An approach that allows flexibility in generating a slower clock frequency is a frequency divider, also called a prescalar. This is basically a counter that generates a pulse every n cycles of its input clock. The output occurs as a pulse with a frequency that is 1/n of the input clock frequency. However, the output pulse has a fixed duration that is one clk period long. 4 The prescalar to be designed is named one_sec_prescalar. If its cnt_en input is asserted at a rate of 32.768 kHz it must generate an output pulse every second. So, this design divides down it input by 32768. The input pulse is one system clock in duration and output pulse is one system clock in duration. This entity must also generate an output named one_hz that is a 1Hz square wave. The entity declaration for the one second prescalar is:

entity one_sec_prescalar is port( clk : in std_logic; -- system clock

rst_n : in std_logic; -- active low synchronous reset

clr_n : in std_logic; -- synchronous clear

cnt_en : in std_logic; -- count enable

one_hz : out std_logic; -- one Hz square wave output

one_sec_tick : out std_logic -- one clock wide pulse every sec );

Solutions

Expert Solution

Since you need 1 Hz as output. And you have 32.768 kHz as input. So, you need divide the input by 32768 which is 8000 in Hex to input pulse. so we set prescale value which will count till 32768 pulse and after it increase the pulse of output signal.


library IEEE;
use IEEE.STD_LOGIC_1164.all;

-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
use IEEE.NUMERIC_STD.all;

entity one_sec_prescalar is 
port (
    clk_32768hz : in  std_logic;
    rst_n       : in  std_logic;
    one_hz   : out std_logic);
end one_sec_prescalar;

architecture Behavioral of one_sec_prescalar is
  signal prescaler : unsigned(15 downto 0);
  signal clk_1Hz_i : std_logic;
begin

  gen_clk : process (clk_32768hz, rst)
  begin  -- process gen_clk
    if rst = '1' then
      clk_2Hz_i   <= '0';
      prescaler   <= (others => '0');
    elsif rising_edge(clk_50Mhz) then   -- rising clock edge
      if prescaler = X"8000" then     -- 32768 in hex
        prescaler   <= (others => '0');
        clk_1Hz_i   <= not clk_1Hz_i;
      else
        prescaler <= prescaler + "1";
      end if;
    end if;
  end process gen_clk;

clk_1Hz <= clk_1Hz_i;

end Behavioral;

Related Solutions

There are many ways to say what Systems Analysis and Design (SAD) is, but one way...
There are many ways to say what Systems Analysis and Design (SAD) is, but one way is to describe it as? A method to solve problems and deliver solution sets Four phases of thought to include planning, Analysis, Design and Implementation How to transform an idea into reality A step by step process of solution-based thinking There is no one way to describe it Problem solving by solving problems All of the above None of the above I have no...
Create a 4-bit Register This is very similar to your flip-flop design from lab task 1....
Create a 4-bit Register This is very similar to your flip-flop design from lab task 1. Ensure that your 4-bit register has inputs “D” (dat, “CLK” (the clock), and “RST” (an asynchronous reset), and an output “Q”. [3 pts] Create a test bench and ensure that your 4-bit register operates correctly (test your reset signal and ensure that you can store a couple different values in the register). If your output behavior is correct, then copy your VHDL design code...
Critically discuss whether it would be desirable to have one model of corporate governance applicable to...
Critically discuss whether it would be desirable to have one model of corporate governance applicable to all countries.
A device is used in many kinds of systems. Assume that all systems have either 1,...
A device is used in many kinds of systems. Assume that all systems have either 1, 2, 3, or 4 of these devices and that each of these four possibilties is equally likely to be the case. Each device in a system has probablility = 0.1 of failing, and the devices function independently of one another. This implies that once we know how many devices are present, the probability distribution of the number of failures will be known. E.g. if...
1. Define the ff: A. Heat- B. Heat capacity- 2. Why is it desirable to have...
1. Define the ff: A. Heat- B. Heat capacity- 2. Why is it desirable to have the water a few degrees colder than room temperature when the initial temperature is taken? 3. Why is the mass of the outer shell of the calorimeter and the insulating ring not included in taking data for Calorimetry? 6. Why should the hot metal be dry before it is introduced into the cold water? 837 calories of heat are required to heat 100.00 grams...
SQL DATABASE Task 2 [10.5 marks] using the AdditionCollege database For task 2, we have provided...
SQL DATABASE Task 2 [10.5 marks] using the AdditionCollege database For task 2, we have provided you with the creation script for the AdditionCollege database. Run this script in MySQL Workbench to create the database. You should execute your query solutions to extract the necessary information. The script is based on the following schematic: Unit (Unit_code, Staff_id, [UnitName]) Staff (Staff_id, StaffName, Position, Gender) Taught_by (Unit_code, Staff_id, weekday) Student (Student_id, Student_name, Address, Gender) TuteGroup (TuteGroup_code, Unit_code, DayHrCode, Room_Nr) TuteGroup_List (TuteGroup_code, Student_id)...
One very important characteristic of organizations in the study of comparative economic systems is the nature...
One very important characteristic of organizations in the study of comparative economic systems is the nature of economies of scale. whether they exhibit capitalism or socialism. the use of computers in the organization. the level of centralization or decentralization of decisions 11 Modern comparative economists would object to the definition of economic systems only in terms of property ownership arrangements, because they recognize that ownership arrangements are not important. there is some private ownership of property in every economic system....
You have been invited to assemble a task force to design a medication assistance program. You...
You have been invited to assemble a task force to design a medication assistance program. You need to submit a proposal, regarding who you would invite, to the CEO. Consider the perspectives of prescribers, discharge planners, financial navigators, patients, suppliers, book keepers and subsidizers. If you were to seek the input of 5-7 stakeholders, who would you invite to the planning table, and why? Consider the need for a group facilitator. Who would that person be, and why?
You have been invited to assemble a task force to design a medication assistance program. You...
You have been invited to assemble a task force to design a medication assistance program. You need to submit a proposal, regarding who you would invite, to the CEO. Consider the perspectives of prescribers, discharge planners, financial navigators, patients, suppliers, book keepers and subsidizers. If you were to seek the input of 5-7 stakeholders, who would you invite to the planning table, and why? Consider the need for a group facilitator. Who would that person be, and why?
You have just joined the design and development group at Panasonic, Inc. The first task you...
You have just joined the design and development group at Panasonic, Inc. The first task you are given is to work on the design of a thermal system to anneal TV glass screens. Each screen is made of semi-transparent glass and weighs 10 kg. You need to heat it from a room temperature of 25°C to 1100°C, maintain it at this temperature for 15 minutes, and then cool slowly to 500°C, after which it may be cooled more rapidly to...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT