Question

In: Electrical Engineering

2. Design a falling-edge triggered SR flip-flop with an active-high asynchronous clear. a) Draw the logic...

2. Design a falling-edge triggered SR flip-flop with an active-high asynchronous clear.

a) Draw the logic symbol and a truth table.

b) Write a complete VHDL model (entity and behavioral architecture)

Solutions

Expert Solution

//-------------------VHDL CODE FOR ASYNCHRONOUS SR FLIFLOP--------///
library IEEE;
use IEEE.std_logic_1164.all;
use ieee. std_logic_arith.all;
use ieee. std_logic_unsigned.all;

entity sr_ff is
port(
     S,R,CLR,clk:in std_logic;
     Q,Q_bar:out std_logic);
     end sr_ff;

Architecture behavioural of sr_ff is
begin

process(clk)
begin

if(CLR='1') then
Q<='0';
end if;

if(clk='0' and clk'event)then
                                  //since it is falling edge triggered
if(S='0' and R='0') then
Q<=Q;
elsif(S='0' and R='1') then      //reset
Q<='0';
elsif(S='1' and R='0') then    //set state
Q<='1';
else
Q<='Z';              //if S=R=1 then it is indetermnate state
end if;
end if;
Q_bar<= not Q;        //generally q_bar is negation of Q

end process;
end behavioural;

(If you have any query leave a comment . Thank you)


Related Solutions

Explain in detail the differences between 4-Bit Synchronous and Asynchronous Counters. Each Flip-Flop is negative-edge triggered....
Explain in detail the differences between 4-Bit Synchronous and Asynchronous Counters. Each Flip-Flop is negative-edge triggered. Use the relevant block diagrams, Truth Table of state sequence, and Timing Diagram to support your explanation.
Explain in detail the differences between 4-Bit Synchronous and Asynchronous Counters. Each Flip-Flop is negative-edge triggered....
Explain in detail the differences between 4-Bit Synchronous and Asynchronous Counters. Each Flip-Flop is negative-edge triggered. Use the relevant block diagrams, Truth Table of state sequence, and Timing Diagram to support your explanation.
Write and verify a behavioral Verilog model of J-K flip-flop with active-low asynchronous reset.
Write and verify a behavioral Verilog model of J-K flip-flop with active-low asynchronous reset.
Write the VHDL PROCESS statements for a D flip-flop with synchronous active-LOW clear, synchronous active-LOW preset,...
Write the VHDL PROCESS statements for a D flip-flop with synchronous active-LOW clear, synchronous active-LOW preset, and responsive to a rising edge clock. Use D for the input, Q for the output, PRE for the preset, CLR for the clear, and CLK for the clock. All signals are BIT type
Write a VHDL code and testbench for a positive-edge-triggered JK-type FF with asynchronous active-low reset (RN)...
Write a VHDL code and testbench for a positive-edge-triggered JK-type FF with asynchronous active-low reset (RN) - JKFFR
Design a 5-bit binary counter using JK flip flops. Draw the flip-flop circuit diagram, the state...
Design a 5-bit binary counter using JK flip flops. Draw the flip-flop circuit diagram, the state graph, the timing diagram, the truth table (with clk pulse) and the state table (with present and next states).
Design a Count-up Counter in Aiken code with following flip flops: a) D-FF (Active edge is...
Design a Count-up Counter in Aiken code with following flip flops: a) D-FF (Active edge is high to low) b) SR-FF (Active edge is high to low) c) Use of output of circuit in part (b) and minimum number of logic gates for getting the Countdown counter in Aiken code
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT