Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Hasrulnizam Hashim, Haibo Wang ECE Department Southern Illinois University Carbondale, IL 62901
2-1
2. AND
X Y
Z=XyY
3. NAND
X Y
0 0 1 1
Z=XyY
2-2
4. OR
X Y
Z=X+Y
5. NOR
X Y
0 0 1 1
Z=X+Y
Y 0 1 0 1
Z 0 1 1 0
4. XOR
X Y
0 0 1 1
5. XNOR
X Y
I1 O I2 S Mux C X Y
2-to-1 multiplexer
Bi-direction circuit
2-4
Decoder Circuits
A decoder circuit uniquely selects one of its outputs according to its input signals
yyy
N inputs
yyy
Decoder
2N outputs
Decoder Circuit
3-to-8 decoder implementation
Assume that we have 2-to-4 decoders available as standard components When CS is low (0), all the outputs of the decoder are low (0)
X Y Z
X Y CS X Y CS X Y CS
2-to-4 decoder
2-6
D Flip-flop
D CLK Q Q D CLK Q D flip-flop will not change its output values unless there is a negative edge event at CLK input (CLK switches from logic 1 to 0). When a negative edge appears at CLK input , D Flip-flop updates Q to the current D value
2-7
Clk
B
DFF Q D Q
C 0 0 0 0 1 1 1 1
B 0 0 1 1 0 0 1 1
A 0 1 0 1 0 1 0 1
Init.
CLK
Synchronous counter
A B C
DFF Q D Q
DFF Q D Q
Q Q
CLK 2-8
CLK
DFF Q D Q
DFF Q D Q
CLK
2-9
Q2
DFF Q D Q
Q1
DFF Q D Q
Q0
Q[3:0]
Data CLK
Shift register
Q3 0 CLK
DFF Q D Q DFF Q D Q
Q2
DFF Q D Q
Q1
DFF Q D Q
Q0
CLK Init.
Q3 1 0 0 0 0
Q2 0 1 0 0 0
Q1 1 0 1 0 0
Q0 0 1 0 1 0
2-10
Memories Circuits
Memories are storage devices containing a large number of storage locations
Addressing space: total number of memory locations If a memory device has N bit addresses, it has 2N memory locations
Row decoder
Memory location
yyy
yyyyy
Memory Types
ROM v.s. RAM
ROM: Read-Only Memory RAM: Random Access Memory (allow both read and write operations)
2-12
Memory Addressing
Example
Use memory chips with the capacity of 1K (1024 bit) to construct a 2K memory system
1K W/R CS
2-13
2-14
Binary Addition
Example
0 1 0 1 + 1 0 0 1 1 1 1 0
C_in
Full adder
C_out
4-bit adder
A[0] B[0] C_in
Full adder
A[1] B[1]
Full adder
A[2] B[2]
Full adder
A[3] B[3]
Full adder
C_0
C_1
C_2
C_out
S[0]
S[1]
S[2]
S[3]
2-15
0 0 0 0 1 1 1 1
0 0 1 1 0 0 1 1
0 1 0 1 0 1 0 1
0 1 2 3 0 -1 -2 -3
Decimal
Ones complement
For positive number A, it is
represented as usual binary number
1s complement
0 0 0 0 1 1 1 1
0 0 1 1 1 1 0 0
0 1 0 1 1 0 1 0
0 1 2 3 0 -1 -2 -3
2-16
0 0 0 0 1 1 1 1
0 0 1 1 1 1 0 0
0 1 0 1 1 0 1 0
0 1 2 3 -1 -2 -3 -4
By using twos complement number representation, minus operations can be performed by adders
3 1 2
Overflow Ignore
0 1 1 1 1 1
2 3 -1
0 1 0 1 0 1 1 1 1 -1
2-17
1 0 1 0 2