Bräunl 2021 CHAPTER 3 Combinatorial and Sequential Circuits Combinatorial Circuits • Only logic gates, no feedback, no memory • No states • Equivalent to mathematical function Sequential Circuits • Logic gates with feedback and memory • States • Equivalent to computer program Which one would you need for implementing: • Game show buzzer ? • Traffic Light ? • Washing machine ? 1 Bräunl 2021 Building Blocks • Combinational Circuits • Flip-Flops • Register • Decoder • Multiplexer / Demultiplexer • Adder • Comparator 2 Bräunl 2021 1. Combinational Circuits • Everything is a combination of AND, OR, NOT gates (or just NAND gates, or just NOR gates) • There are no feedback loops! • There is no memory, every output line is a simple function of its inputs 3 Bräunl 2021 Gates AND OR NOT a b a AND b a OR b NOT a 0 0 0 0 1 0 1 0 1 1 1 0 0 1 0 1 1 1 1 0 a b 4
17
Embed
DES03-ComSeq.Reduce to 150 dpi average quality - STANDARD ...
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Bräunl 2021
CHAPTER 3 Combinatorial and Sequential Circuits
Combinatorial Circuits• Only logic gates, no
feedback, no memory• No states• Equivalent to
mathematical function
Sequential Circuits• Logic gates with
feedback and memory• States• Equivalent to
computer program
Which one would you need for implementing:• Game show buzzer ?• Traffic Light ?• Washing machine ?
Adding 3 input bits (X, Y, Cin)resulting in 2 output bits (sum, Cout)
X Y Cin Cout sum
0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1
0 0 0 1 0 1 1 1
0 1 1 0 1 0 0 1
Bräunl 2021
Full-Adder Implementation (1 stage)
AC out C in
sum
X Y
H
H
X
Y
C in
sumC out
19 Bräunl 2021
Full Adder (n stages)4-bit adder
This is called a ripple carry adder – note propagation delay.Faster: “carry look-ahead“ adder.
C-1A A A AC3
S3 S2 S1 S0
X3 Y3 X2 Y2 X1 Y1 X0 Y0
C0C1 0C2
20
Bräunl 2021
5. Tri-Stateenable
X Y
En X Y
0 0 *
0 1 *
1 0 0
1 1 1
If enable is 0, output is �high-ohm� (not connected)If enable is 1, output equals input
21Diagram: electronics-tutorials.ws
Extension ofbinary logic
Bräunl 2021
Tri-State Implementation
enable
X
Y
En X Y
0 0 *
0 1 *
1 0 0
1 1 1
22
Vcc
Gnd
Note: Never link two outputs together without tri-state !!
Bräunl 2021
6. Latches, Flip-Flops, Memory
• We now introduce a feedback loop• This will allow to “trap” a single bit of information• It is the smallest instance of a memory cell• Required functions:
– Change the bit (set to 1 or reset to 0)– Read the current bit value
23 Bräunl 2021
Memory
If the first input is 0, a 0 gets fed back into it
If the first input is 1, a 1 gets fed back into it
0 0
01 1
1
This circuit will hold its state forever - stable
24Source: Boussaid
Bräunl 2021
Memory
25Source: Boussaid Bräunl 2021
Memory
26Source: Boussaid, Bräunl
Qnew = NOR(R, NOR(Qold, S))
Consider all cases:R S Qnext0 0 __0 1 __1 0 __1 1 not allowed
unchanged10
S
R
Q
Q�
t
S
R
Q
Q�
t
Bräunl 2021
Memory
27Graph: Boussaid
What happens if R,S are both set to 1, then reset to 0?•Uncontrolled oscillation•That’s is why this state is illegal
R
SQQ’
Bräunl 2021
Memory
28
Note:•This circuit’s output Qnext (aka Q+) does depend not only on its inputs R, S – but also on its previous state Q.•This means we have built a sequential circuit. This is nolonger a combinatorial circuit.•We achieved this by using a feedback connection.•We built the smallest instance of a memory cell (1 bit).•The desired initial state (after power-on) is Q=0.However, depending on used chip, initial state may be random.
Edge triggered, similar to RS-FF, but it flips its state when both J=K=1
clk
J K Q(t+1) Operation0 0 Q(t) No change0 1 0 Reset1 0 1 Set1 1 Q’(t) Complement
37 Bräunl 2021
JK-Flip-FlopQ+ = J · Q� + K’ · QHow to build
R
S
Q
QJ
KQ
Qclk
38
9. Registers• Several flip-flops can be combined into one register.• An n-bit register is a group of n binary storage cells (flip-flops).
• Registers are classified according to the number of bits of storage and operating mode:
– parallel in – parallel out (PIPO) ç standard, this is what we’ll use– parallel in – serial out (PISO)– serial in – parallel out (SIPO)– serial in – serial out (SISO)– universal (control signals for either serial or parallel op.)
• Registers are commonly used as temporary storage in a processor.– They are faster and more convenient than main memory.– More registers can help speed up complex calculations.
Bräunl 2021 39Source: Boussaid
Register Example
Bräunl 2021
• Basic registers are easy to build. We can store multiple bits just
by putting a bunch of flip-flops together!
• 4-bit register is (right), and its internal implementation (below).
– All the flip-flops share a common CLK (clock) and CLR
(clear) signal.
40Source: Boussaid
• A shift register �shifts� its output once every clock cycle.• SI is an input that supplies a new bit to shift �into� the register.• E.g., on some positive clock edge we have: SI = 1
Q0-Q3 = 0110
then the next state will be: Q0-Q3 = 1011• The current Q3 (0 in this example) will be lost on the next cycle.• The circuit and example make it look like the register shifts �right�,
but it depends on your interpretation of the bits. If you consider Q3 to be the most significant bit instead, then the register is shifting in the “left”!
Flip-Flop Chip CD4013Note: Some FF have a random initial state.These FF require a power-up reset circuitusing a capacitor to Vcc and a resistor to Gnd.