Professional Documents
Culture Documents
Lecture 4-1
Lecture 4-1
Lecture 4-1
EENG20400
Dr. Roshan Weerasekera
X (n-inputs) Y (m-outputs)
▪ What makes this circuit different from Combinational circuits?
– It requires memory to remember its current status
𝑌 = 𝑓(𝑋, 𝑆)
Sequential circuit classification depends on the times at which their inputs are observed. There are two classes:
• Synchronous → behaviour of output can be defined at discrete events of time. Synchronization is achieved
using a time device (clock generator)
• Asynchronous → behaviour of output can be decided at any instant of time (and the order in which the input
changes.
SR Latch
▪ Latch → storage elements that operate with signal levels (level sensitive devices)
▪ … is created by cross-coupling two NOR gates (NAND gates could also be used). The circuit
state includes the signals Q and Ǭ as these are the signals that are fed back into the circuit.
As long as clk remains at ‘1’, any changes in D will change the state.
Flip-flops (FFs)
… are storage elements that are controlled by a clock transition (edge-sensitive)
Positive-edge triggered FF
Master
Slave
clk D Q(t+1)
0 - Q(t)
By removing this inverter a
negative edge-triggered FF 1 - Q(t)
can be made
D D
▪ For very frequent conditions of Flip-flops one can use the following functions:
– clk’event and clk=‘1’ → rising_edge(clk)
– clk’event and clk=‘0’ → falling_edge(clk)
▪ More attributes are available in the reference material provided in BB or refer to
http://www.csee.umbc.edu/portal/help/VHDL/attribute.html
D Flip-flop with a Reset
▪ there’s a input signal (reset) which sets the state to ‘0’
Synchronous reset
Asynchronous reset
Registers
▪ 1 bit storage element is a flip-flop.
▪ a set of n flip-flops is used to store n bits of information and it is called a register.
Parallel load parallel out Register
D0 Q0 D1 Q1 D2 Q2 D3 Q3
D Q D Q D Q D Q
DataIn(0:N-1) DataOut(0:N-1)
D Q
clk
resetn
Parallel load parallel out Register Example
DataIn(0:N-1) DataOut(0:N-1)
D Q
clk
resetn
Very efficient
Working with Vectors: others keyword
▪ others is a keyword used to refer to all elements not already mentioned
Example:
▪ Q <= “00000100” → Q(2 => ‘1’, others <= ‘0’)
▪ Q <= “11110000” → Q(7 downto 4 => ‘1’, others <= ‘0’)
→ Q(3 downto 0 => ‘0’, others <= ‘1’)
▪ Q <= “10000001” → Q(7|0 => ‘1’, others <= ‘0’)
▪ Q <= “00000000” → Q(others <= ‘0’)
Working with Vectors…
Shift Registers (Example)
DataIn DataOut(0:N-1)
D Q
clk
resetn
Counters
Summary
▪ HDLs are used for modelling and implementation of complex digital circuits using modular approach
▪ Discussed basic VHDL building blocks, Data types and concurrent and sequential VHDL constructs
▪ Not all the features in the language have been introduced/discussed. More will be introduced while working
on the worked examples…
▪ Next Lecture is about…