Professional Documents
Culture Documents
Computer Systems
Lecture 0
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Signals, Logic Operators, and Gates
Operator x _ xy x y xy
sign and
alternat e(s) x or x x y xy x y
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Variations in Gate Symbols
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Gates as Control Elements
Enable/Pass signal Enable/Pass signal
e e
Data out Data in
Data in Data out
x or 0 x
x x or “high impedance”
(a) AND gate for controlled trans fer (b) Tristate buffer
e e
0 0 0
No data
1 1
x ex x or x
(c) Model for AND switch. (d) Model for tristate buffer.
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Wired OR and Bus Connections
ex ex
x
x
ey
ey Data out
y (x, y, z,
y Data out
or high
(x, y, z, or 0)
impedance)
ez
ez
z
z
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Control/Data Signals and Signal Bundles
Enable Compl
8
/
/ / /
/ 8 / 32 / k
8 32 k
(a) 8 NOR gates (b) 32 AND gat es (c) k XOR gat es
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Boolean Functions and Expressions
Ways of specifying a logic function
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Manipulating Logic Expressions
Laws (basic identities) of Boolean algebra.
Associative (x y) z = x (y z) (x y) z = x (y z)
Distributive x (y z) = (x y) (x z) x (y z) = (x y) (x z)
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Proving the Equivalence of Logic Expressions
Example 1.1
Arithmetic substitution
x y = x + y xy
x y = x + y 2xy
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Designing Gate Networks
AND-OR, NAND-NAND, OR-AND, NOR-NOR
x x x
y y y
y y y
z z z
z z z
x x x
(a) A ND-OR circuit (b) Int ermediate circuit (c) NA ND-NA ND equivalent
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
BCD-to-Seven-Segment Decoder
Example 1.2
e0 0
Signals to
4-bit input in [0, 9]
enable or
x3 x2 x1 x0 turn on the e5 5 1
segments
e6 6
e4 4 2
e3 3
e2
e1
The logic circuit that generates the enable signal for the lowermost
segment (number 3) in a seven-segment display unit.
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Useful Combinational Parts
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
x0
Multiplexers
0 x0 0
z x0 z z
x1
x1 1 x1 1
y
y
y (a) 2-to-1 mux (b) Switch view (c) Mux symbol
e (Enable) x0 0
x0 0
/
x1 1 0
0 x1 1 z z
32 /
y0
x2 2
/ 1 32 x2 0 1
x3 3
32
y y1
x3 1
y1y0 y0
(d) Mux array (e) 4-to-1 mux with enable (e) 4-to-1 mux design
Multiplexer (mux), or selector, allows one of several inputs to be
selected and routed to output depending on the binary value of a set of
selection or address signals provided to it.
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Decoders/Demultiplexers
y1 y0
y1 y0
y1 y0
x0
0 x0
0 x0
1 x1
x1 1 x1 e
2 x2
2 x2 (Enable)
3 x3
x2 3 x3
x3
(c) Demultiplexer, or
(a) 2-to-4 decoder (b) Decoder symbol decoder wit h “enable”
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Encoders
x0
x1
x0 0
x1 1
x2
x2 2
x3 3
x3
y1y0
y1y0
(a) 4-to-2 encoder (b) Enc oder symbol
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Programmable Combinational Parts
A programmable combinational part can do the job of
many gates or gate networks
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
PROMs
Inputs
w w
x x
.
Decoder
y y .
.
z z
...
Outputs
(a) Programmable (b) Logic equivalent (c) Programmable read-only
OR gates of part a memory (PROM)
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
PALs and PLAs
Inputs 8-input 6-input
ANDs ANDs
...
AND OR
.
array array
(AND . (OR
plane) . plane)
... 4-input
ORs
Outputs
(a) General programmable (b) PAL: programmable (c) PLA: programmable
combinational logic AND array, fixed OR array AND and OR arrays
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Timing and Circuit Considerations
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Glitching
Using the PAL in Fig. 1.13b to implement f = x y z
x=0
a=x y
f =az
2 2
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
CMOS Transmission Gates
y
P
x0 TG
N x1
TG TG
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Latches, Flip-Flops, and Registers
D R
R
Q Q
Q S Q
S
C
(a) SR latch (b) D latch
D D Q D Q Q D Q / D Q /
k k
FF FF
C C Q C Q Q C Q C Q
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Latches vs Flip-Flops
Setup Hold Setup Hold
time time time time
D latch: Q
D FF: Q
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Reading and Modifying FFs in the Same Cycle
/ D Q /
k k
FF
C Q Computation module
(combinational logic)
/ D Q /
k k
FF
C Q
Propagation delay
Clock
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Finite-State Machines
Example 2.1
------- Input ------- Dime
Current S 10 S 20
Quarter
state
Reset
Dime
Reset
Reset
S 00 S 10 S 25 S 00 Dime Dime
Quarter
S 10 S 20 S 35 S 00 Start
Quarter
S 20 S 30 S 35 S 00 Quarter
S 00 S 25
S 25 S 35 S 35 S 00 Reset
S 30 S 35 S 35 S 00 Reset Dime
Quarter
S 35 S 35 S 35 S 00
Reset
Next state
S 00 is the initial state Dime
S 35 S 30
S 35 is the final state Dime
Quarter
Quarter
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Sequential Machine Implementation
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Designing Sequential Circuits
Example 2.3
Inputs
Quarter in q
Output Final
D Q
e state
C
FF2
Q
is 1xx
Dime in d
D Q
FF1
C Q
D Q
FF0
C Q
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Shift Register
Shift
Load
Parallel data in / 0
k Parallel data out
/ D Q /
Serial data in 1 k k
FF
C Q Serial data out
k – 1 LSBs MSB
/
Register with single-bit left shift and parallel load capabilities. For
logical left shift, serial data in line is connected to 0.
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Register File and FIFO
Write 2 h k -bit registers Muxes
data / / / Write enable
D Q
k k k
Write FF Write
/ C Q / data
address h k Read
Write data 0 k/
/ addr
h
Write / D Q / Read
k k Read
enable FF data 0 / addr 0
C Q h Read
/ data 1 k/
k Read
/
Decoder
h addr 1
k
/ D Q / / Read enable
k k Read
FF
C Q data 1
(b) Graphic symbol
for register file
/ D Q /
k k
FF
C Q Push Full
/ Input Output /
h k k
Read address 0 / Read
enable Empty Pop
h
Read address 1 /
(a) Register file with random access (c) FIFO symbol
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
SRAM
Row decoder
. Square or
Write enable . almost square
. memory matrix
/ Data in
g
Data out /
g
/ Address
h
Chip Output
. . .
select enable Row buffer
. . .
Row
Address / Column mux
h Column
g bits data out
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Binary Counter
Input
IncrInit
0 Mux 1
Load
0 Count register
x
c out c in
Incrementer 1
x+1
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Programmable Sequential Parts
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
PAL and FPGA
8-input I/O blocks
ANDs
CLB CLB
01
CLB CLB
Mu x C D
FF
Q Q
Mu x
01 Configurable Programmable
logic block connections
(a) Portion of PAL with storable output (b) Generic structure of an FPGA
Input
IncrInit
0 Mux 1
Load
0 Count register
x
c out c in
Incrementer 1
x+1
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Clocks and Timing of Events
Clock is a periodic signal: clock rate = clock frequency
The inverse of clock rate is the clock period: 1 GHz 1 ns
Constraint: Clock period tprop + tcomb + tsetup + tskew
D Q Combinational D Q
FF1 FF2
Q
logic Q
C C
Clock1 Clock2
Other inputs
Clock period
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Synchronization
Asynch Synch Asynch Synch
input version input version
D Q D Q D Q
FF FF1 FF2
C Q C Q C Q
Clock
Asynch
input
Synch
version
(c) Input and output waveforms
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.
Level-Sensitive Operation
D Q Combi- D Q Combi- D Q
Latch national Latch national Latch
C Q logic C Q logic C Q
1 2 1
Adapted from: Parhami, Behrooz (2005), Computer Architecture: From Microprocessors to Supercomputers, Oxford
University Press.