Beruflich Dokumente
Kultur Dokumente
A.Amalin Prince
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
1
03-08-07
Objective : Introduction to Digital Systems and Characteristics of Digital ICs
AAP
AAP
AAP
AAP
AAP
AAP
Contd..
The effect of fluctuations in the characteristics of the components, ageing of the components, temperature and noise is very small in digital circuits. Digital circuits have capability of memory which makes these circuits highly suitable for computers, calculators, wrist watches etc. Most Digital Devices are programmable Cost is very less Storage and Data transfer is easy.
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
AAP
Levels of Integration
AAP
AAP
Logic Families
Digital Integrated circuits are classified not only by their complexity or logical operation but also by the specific circuit technology to which they belong. The circuit technology is referred to as a Digital Logic Family
AAP
Logic Families
RTL DTL TTL ECL MOS CMOS Resister-Transistor Logic Diode-Transistor Logic Transistor-Transistor Logic Emitter-coupled Logic Metal-Oxide Semiconductor Complementary Metal-Oxide Semiconductor
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
AAP
AAP
Example
AAP
Fan-Out
Fan-out: The no. of standard loads that can be connected to the output of the gate without degrading its normal operation. Unit: number Standard Load: The amount of current needed by an input of another gate in the same logic family.
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
AAP
I OH
I IH
or
I OL
I IL
whichever is smaller
AAP
Fan-In
Fan-In: The number of inputs available in a Gate Unit: number
AAP
Power Dissipation
It represents the amount of power needed by the gate. It refers to the power delivered to the gate from the power supply.( It does not include the power delivered from another gate) Unit: mW Calculated from : PD ( avg ) = I CC ( avg ) VCC
where I CC ( avg )
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
I CCH + I CCL = 2
Propagation delay
It is the average transition delay time for the signal to propagate from the input to the output when the binary signal changes in value. Unit: ns.
AAP
AAP
Noise Margin
It is the maximum noise voltage that can be added to an input signal of a digital circuit without causing an undesirable change in the circuit output. Noise: AC noise DC noise
AAP
Noise effects. (a) Interconnection of two gates with induced noise. (b) Noise margins.
AAP
Noise margin is
VOH VIH
or VIL VOL
AAP
The End
AAP
Lecture-2
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
1
06-08-07
Objective : Number Systems, Codes, Boolean Algebra and Logic Gates
AAP
Number Systems
Decimal Binary Octal Hexadecimal
AAP
Number Conversion
AAP
AAP
AAP
CODES
Weighted decimal codes Non-weighted decimal codes Unit-Distance codes Alphanumeric codes Error detecting codes
AAP
8421 (BCD) 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001
2421 0000 0001 0010 0011 0100 1011 1100 1101 1110 1111
5421
8 4 -2 -1 00 0 0 01 1 1 01 1 0 01 0 1 01 0 0 10 1 1 10 1 0 10 0 1 10 0 0 11 1 1
7 5 3 -6
0 1 2 3 4 5 6 7 8 9
AAP
8421 (BCD) 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001
Excess-3 Reflected Code 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
0 1 2 3 4 5 6 7 8 9
Self Complementing
U.S. Postal Service bar code corresponding to the ZIP code 14263-1045.
AAP
Unit-Distance Codes
Binary-to-Gray Code Conversion
The most significant bit (left-most) in the Gray code is the same as the corresponding MSB in the binary number. Going from left to right, add (or Ex-OR) each adjacent pair of binary code bits to get the next Gray code bit. Discard carries.
For example conversion from 10110 to Gray is as follows 1 0 1 1 0 Binary
Gray
AAP
Unit-Distance Codes
Gray-to-Binary Code Conversion
The most significant bit (left-most) in the Binary number is the same as the corresponding MSB in the Gray code. Add (or Ex-OR) each binary code bit generated to the Gray code bit in the next adjacent position. Discard carries.
For example conversion from 11011 to Gray is as follows 1 1 0 1 1 Gray
Binary
AAP
Unit-Distance Codes
Decimal Digit
Gray Code 0000 0001 0011 0010 0110 0111 0101 0100
Decimal Digit
Gray Code 1100 1101 1111 1110 1010 1011 1001 1000
0 1 2 3 4 5 6 7
8 9 10 11 12 13 14 15
AAP
Angular position encoders. (a) Conventional binary encoder. (b) Gray code encoder.
AAP
Angular position encoders with misaligned photosensing devices. (a) Conventional binary encoder. (b) Gray code encoder.
AAP
Alphanumeric codes
ASCII Code
AAP
AAP
Logic Gates
AAP
Logic Gates
AAP
Boolean Algebra
Boolean Algebra is used to simply/rearrange Boolean equation to make simple logic circuit.
AAP
Associative Laws
Law 1: A+(B+C) = (A+B)+C Law 2: A(BC)= (AB)A
Distributive Laws
Law : A(B+C) = AB+AC
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
AAP
No. 1. 2. 3. 4. 5. 6. 7. 8.
Law
AAP
Duality Theorem
The duality theorem says that, starting with a Boolean relation, you can derive another Boolean relation by
Changing each OR sign to an AND sign Changing each AND sign to an OR sign Complementing any 0 or 1 appearing in the expression
AAP
Theorems
DeMorgans Law 1: A.B = A+B Law 2: A+B = A.B
Consensus theorem Law : AB+AC+BC = AB+AC Dual of Consensus theorem Law : (A+B)(A+C)(B+C) = (A+B)(A+C)
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
AAP
Operator Precedence
Parentheses NOT AND OR
AAP
1. F = XY + XYZ + XY Z + XYZ
2. AB + A + AB
3. AB + AC + ABC ( AB + C )
AAP
The End
AAP
Lecture-3
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
1
08-08-07
Objective : Simplification of Boolean functions (Gate Level Minimization)
AAP
AAP
AAP
Y Z 0 0 0 1 1 0 0 1 1 1 0 1 0 1 0 1
Minterms Term Designation XYZ m0 XYZ XYZ XYZ XYZ XYZ XYZ XYZ m1 m2 m3 m4 m5 m6 m7
Maxterms Term Designation X+Y+Z M0 X+Y+Z X+Y+Z X+Y+Z X+Y+Z X+Y+Z X+Y+Z X+Y+Z M1 M2 M3 M4 M5 M6 M7
Q 0 0 1 1 0 0 1 1
R 0 1 0 1 0 1 0 1
Function F1 0 0 0 0 0 1 1 1
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Function F2 0 1 0 1 0 1 0 1
F1 = m(5, 6, 7)
SOP
F 2 = m(1,3,5, 7)
F1 = M (0,1, 2,3, 4)
POS
F 2 = M (0, 2, 4, 6)
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Try yourself
Convert the given expression in canonical SOP form Y=AC+AB+BC Y=ABC+ABC+ABC+ABC Convert the given expression in canonical POS form Y=A(A+B)(A+B+C) Y=(A+B+C)(A+B+C)(A+B+C)(A+B+C)
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Digital Design
Optimizations and Tradeoffs
AAP
Introduction
We now know how to build digital circuits
How can we build better circuits?
i s
16 transistors 2 gate-delays F1
4 transistors 1 gate-delay w x F2
( t
= wx(y+y) = wx
F2 = wx
CS GC391/EEE GC391/INSTR GC391 (b) BITS-Pilani Goa Campus
Introduction
Tradeoff
Improves some, but worsens other, criteria of interest
Transforming G1 to G2 represents a tradeoff: Some criteria better, others worse.
14 transistors 2 gate-delays w G1 w y z G1 = wx + wy + z x y z G2 = w(x+y) + z
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
w x
size (transistors)
12 transistors 3 gate-delays
e z
20 15 10 5 1 2 3 4 delay (gate-delays) G1 G2
G2
AAP
Introduction
Tradeoffs Optimizations
All criteria of interest are improved (or at least kept the same) size size
e e z z i s i s
delay
i s
delay
a n s i
You cant build a car that is the most comfortable, and has the best fuel efficiency, and is the fastest you have to give up something to gain other things.
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Note: Assuming 4-transistor 2-input AND/OR CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus NAND/NOR are so efficient. in reality, only
circuits;
AAP
AAP
Easy to miss seeing possible opportunities to combine terms Karnaugh Maps (K-maps)
Graphical method to help us find opportunities to combine terms Minterms differing in one variable are adjacent in the Notice not in binary order map F yz
x 0 1 00 01 11 10
The End
AAP
Lecture-4
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
1
10-08-07
Objective : Simplification of Boolean functions (Gate Level Minimization)
AAP
AAP
AAP
F = xyz + xyz + xyz + xyz Can clearly see opportunities to combine terms look for adjacent 1s
For F, clearly two opportunities Top left circle is shorthand for xyz+xyz = xy(z+z) = xy(1) = xy Draw circle, write term that has all the literals except the one that changes in the circle
Circle xy, x=1 & y=1 in both cells of the circle, but z changes (z=1 in one cell, 0 in the other)
F yz 00 01 11 10 x 0 1 1 0 0 1 0 0 1 1
F yz 00 01 11 10 x 0 1 1 0 0 1 0 0 1 1 xy xy F = xy + xy
F = xyz + xyz + xyz + xyz F = xy(z + z) + xy(z + z) F = xy*1 + xy*1 F = xy + xy
K-maps
Four adjacent 1s means two variables can be eliminated
G = xyz + xyz + xyz + xyz G = x(yz+ yz + yz + yz) (must be true) G = x(y(z+z) + y(z+z)) G = x(y+y) G = x G yz x 00 01 11 10
0 0 0 0 0 Makes intuitive sense those two variables 1 1 1 1 1 x appear in all combinations, so one Draw the biggest circle possible, or youll have more terms than really needed must be true G yz x 00 01 11 10 Draw one big circle 0 0 0 0 0 shorthand for the algebraic 1 1 1 1 1 xy xy transformations above
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
K-maps
H yz (xy appears in all combinations) Four adjacent cells can be in x shape of a square 00 01 11 10 0 0 1 1 0 OK to cover a 1 twice z Just like duplicating a term 1 0 1 1 0 Remember, c + d = c + d + d I yz yz No need to cover 1s x 00 01 11 10 more than once 0 0 1 0 0 Yields extra terms not minimized 1 1 1 1 1
J yz xy yz x 00 01 11 10 0 1
AAP
1 0
1 1
0 1
0 0
xz
x The two circles are shorthand for: I = xyz + xyz + xyz + xyz + xyz I = xyz + xyz + xyz + xyz + xyz + xyz I = (xyz + xyz) + (xyz + xyz + xyz + xyz) I = (yz) + (x)
K-maps
Circles can cross left/right sides Remember, edges are adjacent Minterms differ in one variable only Circles must have 1, 2, 4, or 8 cells 3, 5, or 7 not allowed 3/5/7 doesnt correspond to algebraic transformations that combine terms to eliminate a variable Circling all the cells is OK Function just equals 1
K yz x 00 0 1 0
1
xyz 01 1 0 11 0 0 10 0
1
xz
L yz x 00 0 1 0 1
01 11 0 1 0 1
10 0 0
E yz x 00 0 1 1 1
01 11 10 1 1 1 1 1 1 1
AAP
xz
xy
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
f xy+xz
Try yourself
AAP
AAP
01 1 11 0 10 0
1 0 0 yz
1 1 1
0 0 0
G yz wx 00 01 11 10 00 0 1 1 0 01 0 11 0 10 0 z
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
F=wxy+yz
1 1 1
1 1 1
0 0 0
G=z
H c d ab 00 01 11 10 00 01 11 10 1 0 0 1 0 1 0 0 0 1 0 0 1 1 0 1
H = bd + abc + abd
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Funny-looking circle, but remember that left/right adjacent, and top/bottom adjacent
AAP
AAP
Try Yourself
F ( P, Q, R, S ) = m(0,1, 4,8,9,10)
AAP
AAP
1 1 1 1 1
1 1 1
1
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Simplify F=m(0,2,4,6,9,13,21,23,25,29,31)
AAP
AAP
The End
AAP
Lecture-5
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
1
13-08-07
Objective : Simplification of Boolean functions (Gate Level Minimization)
AAP
On K-map
Draw Xs for dont care combinations
Include X in circle ONLY if minimizes equation Dont include other Xs
00 0 1 X 1
01 11 10 0 X 0 0 0 0 xy
AAP
F = ac + b
Outputs 1 when switch is in position 2, 3, or 4 1 1 0 Outputs 0 when switch is in G yz position 1 or 5 y x 00 01 11 10 Note that the 3-bit input can 0 X 0 1 1 never output binary 0, 6, or 7
Treat as dont care input combinations
AAP
xy xyz
Try yourself
F ( P, Q, R, S ) = m(1,3, 7,11,15) + d (0, 2, 4)
AAP
yz 00 1 1 01 1 0 11 1 1 10 0 1 xy
1 yz I x 0
(b)
yz 00 1 1
xy yz 4 terms 01 1 0 11 1 1
10 0 1
1 yz
xz xy Only 3 terms
AAP
4 implicants of F
Note: We use K-maps here just for intuitive illustration of concepts; automated tools do not use K-maps.
xy is an expansion of xyz
Prime implicant: Product term obtained by combining the maximum possible number of adjacent squares in the map. xyz, and xy, above But not xyz or xyz they can be expanded
Essential prime implicant: If a minterm in a square is 0 covered by only one prime 1 implicant, that prime implicant xy is essential prime implicat. essential
Importance: We must include all essential PIs in a functions cover In contrast, some, but not all, non-essential PIs will be included
xz not essential
AAP
Steps 1 and 2 are exact Step 3: Hard. Checking all possibilities: exact, but computationally expensive. Checking some but not all: heuristic.
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
y x z y I yz x z x 00 01 11 10 (c ) 0 1 1 1 y z 1 0 1 0 0 1
xz
AAP
AAP
The End
AAP
Lecture-6
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
1
17-08-07
Objective : Simplification of Boolean functions (Gate Level Minimization)
AAP
Quine-McCluskey Method
AAP
Motivation
Karnaugh maps are very effective for the minimization of expressions with up to 5 or 6 inputs. However they are difficult to use and error prone for circuits with many inputs. Karnaugh maps depend on our ability to visually identify prime implicants and select a set of prime implicants that cover all minterms. They do not provide a direct algorithm to be implemented in a computer. For larger systems, we need a programmable method!!
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Quine-McCluskey
Willard van Orman Quine 1908-2000, Edgar Pierce Chair of Philosophy at Harvard University.
http://members.aol.com/drquine/wv-quine.html
Quine, Willard, The problem of simplifying truth functions.
AAP
AAP
We can combine the minterms above because they differ by a single bit. The minterms below wont combine
ABCD + ABCD 0101 +0110
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
AAP
binary 0000 0001 0010 0101 0110 0111 1000 1001 1010 1110
Group the minterms according to the number of 1s in the minterm. This way we only have to compare minterms from adjacent groups.
Column II
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 000-
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000
7 0111 14 1110
AAP
Column II
0,1 0,2 0,8 1,5 00000-0 -000 0-01
group 3
7 0111 14 1110
AAP
Column II
0,1 0,2 0,8 1,5 00000-0 -000 0-01
group 3
7 0111 14 1110
AAP
Column II
0,1 0,2 0,8 1,5 1,9 00000-0 -000 0-01 -001
group 3
7 0111 14 1110
AAP
Column II
0,1 0,2 0,8 1,5 1,9 00000-0 -000 0-01 -001
group 3
7 0111 14 1110
AAP
Column II
0,1 0,2 0,8 1,5 1,9 00000-0 -000 0-01 -001
group 3
7 0111 14 1110
AAP
Column II
0,1 0,2 0,8 1,5 1,9 00000-0 -000 0-01 -001
group 3
7 0111 14 1110
AAP
Column II
0,1 0,2 0,8 1,5 1,9 2,6 00000-0 -000 0-01 -001 0-10
group 3
7 0111 14 1110
AAP
Column II
0,1 0,2 0,8 1,5 1,9 2,6 00000-0 -000 0-01 -001 0-10
group 3
7 0111 14 1110
AAP
Column II
0,1 0,2 0,8 1,5 1,9 2,6 2,10 00000-0 -000 0-01 -001 0-10 -010
group 3
7 0111 14 1110
AAP
Column II
0,1 0,2 0,8 1,5 1,9 2,6 2,10 00000-0 -000 0-01 -001 0-10 -010
group 3
7 0111 14 1110
AAP
Column II
0,1 0,2 0,8 1,5 1,9 2,6 2,10 00000-0 -000 0-01 -001 0-10 -010
group 3
7 0111 14 1110
AAP
Column II
0,1 0,2 0,8 1,5 1,9 2,6 2,10 8,9 00000-0 -000 0-01 -001 0-10 -010 100-
group 3
7 0111 14 1110
AAP
Column II
0,1 0,2 0,8 1,5 1,9 2,6 2,10 8,9 8,10 00000-0 -000 0-01 -001 0-10 -010 10010-0
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0,2 0,8 1,5 1,9 2,6 2,10 8,9 8,10 00000-0 -000 0-01 -001 0-10 -010 10010-0
7 0111 14 1110
AAP
Column II
0,1 0,2 0,8 1,5 1,9 2,6 2,10 8,9 8,10 5,7 00000-0 -000 0-01 -001 0-10 -010 10010-0 01-1
group 3
7 0111 14 1110
AAP
Column II
0,1 0,2 0,8 1,5 1,9 2,6 2,10 8,9 8,10 5,7 00000-0 -000 0-01 -001 0-10 -010 10010-0 01-1
group 3
7 0111 14 1110
AAP
Column II
0,1 0,2 0,8 1,5 1,9 2,6 2,10 8,9 8,10 5,7 6,7 00000-0 -000 0-01 -001 0-10 -010 10010-0 01-1 011-
group 3
7 0111 14 1110
AAP
Column II
0,1 0,2 0,8 1,5 1,9 2,6 2,10 8,9 8,10 5,7 6,7 6,14 00000-0 -000 0-01 -001 0-10 -010 10010-0 01-1 011-110
group 3
7 0111 14 1110
AAP
Column II
0,1 0,2 0,8 1,5 1,9 2,6 2,10 8,9 8,10 5,7 6,7 6,14 00000-0 -000 0-01 -001 0-10 -010 10010-0 01-1 011-110
group 3
7 0111 14 1110
AAP
Column II
0,1 0,2 0,8 1,5 1,9 2,6 2,10 8,9 8,10 5,7 6,7 6,14 00000-0 -000 0-01 -001 0-10 -010 10010-0 01-1 011-110
group 3
7 0111 14 1110
AAP
Column II
0,1 0,2 0,8 1,5 1,9 2,6 2,10 8,9 8,10 5,7 6,7 6,14 00000-0 -000 0-01 -001 0-10 -010 10010-0 01-1 011-110
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
0,1,8,9 -00-
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
0,1,8,9 -00-
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
0,1,8,9 -00-
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
0,1,8,9 -00-
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
0,1,8,9 -00-
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
0,1,8,9 -00-
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
0,1,8,9 -00-
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
0,1,8,9 -000,2,8,10 -0-0
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
0,1,8,9 -000,2,8,10 -0-0
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
0,1,8,9 -000,2,8,10 -0-0 0,8,1,9 -00-
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
0,1,8,9 -000,2,8,10 -0-0 0,8,1,9 -00-
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
0,1,8,9 0,2,8,10 0,8,1,9 0,8,2,10 -00-0-0 -00-0-0
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
0,1,8,9 0,2,8,10 0,8,1,9 0,8,2,10 -00-0-0 -00-0-0
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
0,1,8,9 0,2,8,10 0,8,1,9 0,8,2,10 -00-0-0 -00-0-0
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
0,1,8,9 0,2,8,10 0,8,1,9 0,8,2,10 -00-0-0 -00-0-0
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
0,1,8,9 0,2,8,10 0,8,1,9 0,8,2,10 -00-0-0 -00-0-0
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
0,1,8,9 0,2,8,10 0,8,1,9 0,8,2,10 2,6,10,14 -00-0-0 -00-0-0 --10
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
0,1,8,9 0,2,8,10 0,8,1,9 0,8,2,10 2,6,10,14 2,10,6,14 -00-0-0 -00-0-0 --10 --10
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
0,1,8,9 0,2,8,10 0,8,1,9 0,8,2,10 2,6,10,14 2,10,6,14 -00-0-0 -00-0-0 --10 --10
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
0,1,8,9 0,2,8,10 0,8,1,9 0,8,2,10 2,6,10,14 2,10,6,14 -00-0-0 -00-0-0 --10 --10
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
0,1,8,9 0,2,8,10 0,8,1,9 0,8,2,10 2,6,10,14 2,10,6,14 -00-0-0 -00-0-0 --10 --10
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
0,1,8,9 0,2,8,10 0,8,1,9 0,8,2,10 2,6,10,14 2,10,6,14 -00-0-0 -00-0-0 --10 --10
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
Column III
0,1,8,9 -000,2,8,10 -0-0 2,6,10,14 --10
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
0,1,8,9 -000,2,8,10 -0-0 2,6,10,14 --10
group 2
f = acd + abd
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
0,1,8,9 -000,2,8,10 -0-0 2,6,10,14 --10
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
0,1,8,9 -000,2,8,10 -0-0 2,6,10,14 --10
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
0,1,8,9 -000,2,8,10 -0-0 2,6,10,14 --10
group 2
group 3
7 0111 14 1110
AAP
Column II
0,1 0000,2 00-0 0,8 -000 1,5 0-01 1,9 -001 2,6 0-10 2,10 -010 8,9 1008,10 10-0 5,7 01-1 6,7 0116,14 -110 10,14 1-10
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Column III
0,1,8,9 -000,2,8,10 -0-0 2,6,10,14 --10
group 2
group 3
7 0111 14 1110
AAP
1 d
AAP
1 d 1
AAP
1 d 1
AAP
1 1
1 d
AAP
1 1
1 d 1
AAP
1 1 1
1 d 1
AAP
F = abd
1 1 1
1 d 1
AAP
F = abd + cd
1 1 1
1 d 1
AAP
F = abd + cd + bc
1 1 1
1 d 1
AAP
F = abd + cd + bc
1 d 1 1
Thus, we need a method to 11 c eliminate this redundant terms 10 from the Quine-McCluskey solution.
AAP
AAP
Question: Given the prime implicant chart above, how can we identify the essential prime implicants of the function?
AAP
Similar to the Karnaugh map, all we have to do is to look for minterms that are covered by a single term.
AAP
Once a term is included in the solution, all the minterms covered by that term are covered. Therefore we may now mark the covered minterms and find terms that are no longer useful.
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
AAP
As we have not covered all the minterms with essential prime implicants, we must choose enough non-essential prime implicants to cover the remaining minterms.
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
AAP
What strategy should we use to find a minimum cover for the remaining minterms?
AAP
We choose first prime implicants that cover the most minterms. Should this strategy always work??
AAP
AAP
0 1 2 5 6 7
Which ones are the essential prime implicants in this chart? There is no essential prime implicants, how we proceed?
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Prime Implicants
0 1 2 5 6 7
Also, all implicants cover the same number of minterms. We will have to proceed by trial and error.
F(a,b,c) = ab
AAP
Prime Implicants
0 1 2 5 6 7
Also, all implicants cover the same number of minterms. We will have to proceed by trial and error.
F(a,b,c) = ab + bc
AAP
Prime Implicants
0 1 2 5 6 7
AAP
Prime Implicants
0 1 2 5 6 7
AAP
Prime Implicants
0 1 2 5 6 7
AAP
Prime Implicants
0 1 2 5 6 7
AAP
Prime Implicants
0 1 2 5 6 7
AAP
Prime Implicants
0 1 2 5 6 7
AAP
Prime Implicants
Which minimal form is better? Depends on what terms we must form for other functions that we must also implement. Often we are interested in examining all minimal forms for a given function. Thus we need an algorithm to do so.
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
AAP
AAP
AAP
AAP
F=m(0,5,7,8,9,12,13,23,24,25,28,29,37,40 ,42,44,46,55,56,57,60,61)
AAP
The End
AAP
Lecture-7
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
1
20-08-07
Objective : Combinational Logic & MSI Components
AAP
Combinational Networks
AAP
Analysis Procedure
AAP
Design Procedure
From the specification of the circuit, determine the required number of inputs and out-puts and assign a symbol to each. Derive the truth table that defines the required relationship between inputs and outputs. Obtain the simplified Boolean function for each output as a function of the input variables. Draw the logic diagram and verify the corrections of the diagram.
AAP
Code Converter
What is a code converter? Why it is needed? Design a BCD to Excess-3 code converter?
Possibilities? Step1:
A B C D W
Excess-3 Output
BCD Input
X Y Z
AAP
Step 2
A 0 0 0 0 0 0 0 0 1 1
AAP
BCD Input B C 0 0 0 0 0 1 0 1 1 0 1 0 1 1 1 1 0 0 0 0
D 0 1 0 1 0 1 0 1 0 1
Excess-3 Output W X Y Z 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0
Step-3
W = m(5, 6, 7,8,9) + d (10,11,12,13,14,15) X = m(1, 2,3, 4,9) + d (10,11,12,13,14,15) Y = m(0,3, 4, 7,8) + d (10,11,12,13,14,15) Z = m(0, 2, 4, 6,8) + d (10,11,12,13,14,15)
AAP
AAP
Step-4
AAP
Binary Adder-Subtractor
AAP
Half-Adder
Half-adder: Adds 2 bits, generates sum and carry Design using combinational design process
Step 2: Convert to equations
co = ab s = ab + ab (same as s = a xor b)
a b a b
Half-adder
co s co s
AAP
Full-Adder
Full-adder: Adds 3 bits, generates sum and carry Design using combinational design process
Step 1: Capture the function
Inputs a 0 0 0 0 1 1 1 1 b 0 0 1 1 0 0 1 1 ci 0 1 0 1 0 1 0 1 Outputs co 0 0 0 1 0 1 1 1 s 0 1 1 0 1 0 0 1
Full adder
co
co = abc + abc + abc + abc co = abc +abc +abc +abc +abc +abc co = (a+a)bc + (b+b)ac + (c+c)ab co = bc + ac + ab s = abc + abc + abc + abc s = a(bc + bc) + a(bc + bc) s = a(b xor c) + a(b xor c) s = a xor b xor c
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
AAP
co
ci
AAP
Half Subtractor
Subtracting a single-bit binary value Y from anther X (I.e. X -Y ) produces a difference bit D and a borrow out bit B-out. This operation is called half subtraction and the circuit to realize it is called a half subtractor. D(X,Y) = (1,2) Half Subtractor Truth Table D = XY + XY Outputs Inputs D = XY
X 0 0 1 1
X Y
Y 0 1 0 1
Half Subtractor
D B-out 0 0 1 1 1 0 0 0
D B-OUT
B-out
AAP
Full Subtractor
Subtracting two single-bit binary values, Y, Difference D XY B-in from a single-bit value X produces a B-in 00 01 difference bit D and a borrow out B-out 0 2 bit. This is called full subtraction. 1 0
X
11
6 7
10
4 5
1
B-in
X 0 0 0 0 1 1 1 1
Y 0 0 1 1 0 0 1 1
B-in 0 1 0 1 0 1 0 1
D 0 1 1 0 1 0 0 1
B-out 0 1 1 1 0 0 0 1
Borrow B-out
XY B-in 0
00 0
1
01
2 3
11
6 7
10
4 5
1 1
Y
B-in
AAP
Difference D
B-in
XYB-in
X Y
XY
B-out
Full Subtractor
D
B-in
X B-in Y B-in
XB-in
B-out
YB-in
AAP
X Y B-in
Difference D
B-out
Full Subtractor
D
B-in
Y X B-in Y B-in
XY
XB-in
B-out
YB-in
AAP
A: B:
1 1 1 1 + 0 1 1 0
1 0 1 0 1 1 A: 1 B: 0 b a ci co s 1 0 1 1 1 b a ci co s 1 0 1 1 b a ci co s 0 1 0 b a co s 1 SUM
Full-adders
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Half-adder
Carry-Ripple Adder
Using half-adder and full-adders, we can build adder that adds like we would by hand Called a carry-ripple adder
4-bit adder shown: Adds two 4-bit numbers, generates 5-bit output
5-bit output can be considered 4-bit sum plus 1-bit carry out
a3 a2 a1 a0
b3 b2b1b0
co
s3
s2 (a)
s1
s0 (b)
AAP
Carry-Ripple Adder
Using full-adder instead of half-adder for first bit, we can include a carry in bit in the addition
Will be useful later when we connect smaller adders to form bigger adders
a3 b3 a b ci F A co s co a2 b2 a b ci F A s co a1 b1 a b ci F A s co a0 b0 ci a b ci F A s co
a3 a2 a1 a0
b3 b2b1b0 ci
4-bit adder s3 s2 s1 s0
co
s3
s2 (a)
s1
s0 (b)
AAP
000 a b ci F A co 0 s 0
0111+ 0001
(answer should be 01000)
a b ci F A co s 0 1 co0
Wrong answer -- something wrong? No -- just need more time for carry to ripple through the chain of full adders.
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
000 a b ci F A co s 0 0
(c)
a b ci F A c s o 1 0 11 0
0 00 1 a b ci F A co s 0 1
a b ci F A c s o 1 0
Cascading Adders
a7a6a5a4 a3a2a1a0
b7b6b5b4 b3b2b1b0 ci
a3a2a1a0 a3a2a1a0
(b)
AAP
a7..a0
b7..b0 ci 0
CALC LEDs
AAP
a7..a0
co e clk
s7..s0
ld
AAP
01000010
a7..a0
ci
1 clk
ld
Weight Adjuster
to display
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
AAP
The End
AAP
Lecture-8
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
1
22-08-07
Objective : Combinational Logic & MSI Components
AAP
000 a b ci F A co 0 s 0
0111+ 0001
(answer should be 01000)
a b ci F A co s 0 1 co0
Wrong answer -- something wrong? No -- just need more time for carry to ripple through the chain of full adders.
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
000 a b ci F A co s 0 0
(c)
a b ci F A c s o 1 0 11 0
0 00 1 a b ci F A co s 0 1
a b ci F A c s o 1 0
Gi = Ai Bi
Pi = Ai Bi
Si = Pi Ci
Ci +1 = Gi + PCi i
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Gi = Ai Bi
AAP
For a 4-bit carry look-ahead adder the expanded expressions for all carry bits are given by:
C0 = input carry
C1 = G0 + P0C0
C2 = G1 + PC1 = G1 + P (G0 + P0C0 ) 1 1 = G1 + PG0 + P P0C0 1 1
C3 = G2 + P2C2 = G2 + P2G1 + P2 PG0 + P2 P P0C0 1 1
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
The additional circuits needed to realize the expressions are usually referred to as the carry look-ahead logic. Using carry-ahead logic all carry bits are available after three gate delays regardless of the size of the adder.
AAP
AAP
AAP
Binary Subtractor
B3
A3 B2
A2
B1
A1 B 0
A0 1 1
AAP
Adder Subtractor
0
B3
A3
B2
A2
B1
A1
B0
A0
AAP
Adder Subtractor
1
B3
A3 B2
A2
B1
A1
B0
A0
AAP
The End
AAP
Lecture-9
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
1
24-08-07
Objective : Combinational Logic & MSI Components
AAP
Binary Sum K
BCD Sum C S8 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 S4 0 0 0 0 1 1 1 1 0 0 0 0 0 0 1 1 1 1 S2 S1 0 0 1 1 0 0 1 1 0 0 0 0 1 1 0 0 1 1 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Decimal 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
D e c i m a l A d d e r
Z8 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0
Z4 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
Z2 Z1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1
0 1
AAP
Decimal Adder
AAP
Digital Comparator
A B
N-bit comparator
A>B
A=B
A<B
AAP
XOR Comparator
Compare two numbers and decide if they are equal.
AAP
Inputs A1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
AAP
Outputs B1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 B0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 A>B 0 0 0 0 1 0 0 0 1 1 0 0 1 1 1 0
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
A0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
A=B 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
A<B 0 1 1 1 0 0 1 1 0 0 0 1 0 0 0 0
Logic Diagram
AAP
AAP
AAP
Function Table
Comparing Inputs AB A>B A=B Cascading Inputs If Outputs I(A>B) I(A=B) I(A<B) A>B A=B A<B 0 0 1 1 0 0 1 A<B 0 1 0 0 0 0 1 0 1 1 0 0 1 0 0 0 1 0 0 0 0 0 0 1 1 0 1
AAP
AAP
AAP
AAP
Decoder
A decoder accepts a set of inputs that represents a binary number and activates only the output that corresponds to that input number.
AAP
AAP
2.9
Decoders
Decoder: Popular combinational logic building block, in addition to logic gates
Converts input binary number to one high output
d0 i0 d1 i1 d2 d3
0 1 0
0 1
d0 i0 d1 i1 d2 d3
0 0 1
1 1
d0 i0 d1 i1 d2 d3
0 0
0
AAP
Internal design
AND gate for each output to detect input combination
d0 d1 d2 d3
d0 d1 d2 d3
0 0 0 1
0 0 0 0
d1 d2 d3
A 3-to-8-line decoder.
Truth table Logic Symbol
AAP
Logic Diagram
AAP
Realization of the Boolean expressions f1(x2,x1,x0) = m(1,2,4,5) and f2(x2,x1,x0) = m(1,5,7) with a 3-to-8-line decoder and two or-gates.
AAP
Realization of the Boolean expressions f1(x2,x1,x0) = m(0,1,3,4,5,6) = m(2,7) and f2(x2,x1,x0) = m(1,2,3,4,6) = m(0,5,7) with a 3-to-8-line decoder and two nor-gates.
AAP
A decoder realization of f1(x2,x1,x0) = M(0,1,3,5) and f2(x2,x1,x0) = M(1,3,6,7) (a) Using output or-gates. (b) Using output nor-gates.
AAP
Symbol
Truth table
AAP
Logic Diagram
AAP
Realization of the pair of maxterm canonical expressions f1(x2,x1,x0) = M(0,3,5) and f2(x2,x1,x0) = M(2,3,4) with a 3-to-8-line decoder and two and-gates.
AAP
Realization of the Boolean expressions f1(x2,x1,x0) = M(0,1,3,4,7) = M(2,5,6) and f2(x2,x1,x0) = M(1,2,3,4,5,6) = M(0,7) with a 3to-8-line decoder and two nandgates.
AAP
A decoder realization of f1(x2,x1,x0) = m(0,2,6,7) and f2(x2,x1,x0) = m(3,5,6,7) (a) Using output and-gates. (b) Using output nand-gates.
AAP
And-gate 2-to-4-line decoder with an enable input. (a) Logic diagram. (b) Compressed truth table. (c) Symbol.
AAP
Nand-gate 2-to-4-line decoder with an enable input. (a) Logic diagram. (b) Compressed truth table. (c) Symbol.
AAP
AAP
Decoder Example
New Years Eve Countdown Display
Microprocessor counts from 59 down to 0 in binary on 6-bit output Want illuminate one of 60 lights for each binary number Use 6x64 decoder
4 outputs unused
essor c o r
2 10
0 1 0 0 0 0 10 00 00 00 00 00
i0 i1 i2 i3 i4 i5 d0 d1 d2 d3
21 0
0 0 1 0 01 10 00 00
0 1 2 3
op
ic
000 000
58 59
AAP
The End
AAP
Lecture-10
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
1
27-08-07
Objective : Combinational Logic & MSI Components
AAP
realize f1(x2,x1,x0) = M(0,1,3,5) and f2(x2,x1,x0) = M(1,3,6,7) (a) Using Decoder and output OR-gates. (b) Using Decoder and output NOR-gates.
AAP
Symbol
Truth table
AAP
Logic Diagram
AAP
Realize the pair of maxterm canonical expressions f1(x2,x1,x0) = M(0,3,5) and f2(x2,x1,x0) = M(2,3,4) with a 3-to-8-line decoder and two AND-gates.
AAP
Realize the Boolean expressions f1(x2,x1,x0) = M(0,1,3,4,7) = M(2,5,6) and f2(x2,x1,x0) = M(1,2,3,4,5,6) = M(0,7) with a 3to-8-line decoder and two NANDgates.
AAP
realize f1(x2,x1,x0) = m(0,2,6,7) and f2(x2,x1,x0) = m(3,5,6,7) (a) Using Decoder and output ANDgates. (b) Using Decoder and output NAND-gates.
AAP
And-gate 2-to-4-line decoder with an enable input. (a) Logic diagram. (b) Compressed truth table. (c) Symbol.
AAP
Nand-gate 2-to-4-line decoder with an enable input. (a) Logic diagram. (b) Compressed truth table. (c) Symbol.
AAP
AAP
AAP
Encoders
Has several inputs only of which one is usually active at a time. Produces an N-bit output code dependent upon which input is activated. (opposite of decoding)
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
AAP
8-Line-To-3-Line Encoder
Note that A0 is not internally connected (A1A7=1111111, then Q2Q1Q0=000 Only one input should be low. Example: If A3 = A5 =0, and all other are High, then Q2Q1Q0=0112 (=310), NOT ACCEPTABLE
AAP
Priority Encoders
Priority encoders When 2 or more inputs are activated, the output code will correspond to the highest-numbered input. Example: If both A3 and A5 are low, then output code = 101 (510) If A6, A2, and A0 are all low, then output code = 110 (610) The 74148, 74LS148, and 74HC148 octal to binary priority encoders
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
AAP
Outputs D3 0 0 0 0 1 X X 0 0 1 1 Y X 0 1 0 1 V 0 1 1 1 1
D1 0 0 1 X X
D2 0 0 0 1 X
AAP
AAP
Priority Encoders
74147 decimal-to-BCD priority encoder.
Nine active low inputs representing decimal 1 thru 9 Output: inverted BCD code corresponding to the highest numbered activated input. Outputs can be converted to normal BCD by putting each through an inverter. No A0. When all inputs are high, it corresponds to decimal 0
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
AAP
Priority Encoders
The 74147 as a Decimal-to-BCD switch encoder
Example: a keyboard switch or a calculator Simultaneous key depressions will produce the BCD code for the highernumbered key.
AAP
Priority Encoders
The 74148, 74LS148, and 74HC148 octal to binary priority encoders It has Enable Input (EI) and Enable Output (EO) that can be used to cascade two ICs producing a hexadecimal-to-binary encoder
AAP
Gate Delays
In verilog delay is specified in terms of time units and the symbol #. Compiler directive timescale (Compiler directive start with the [backquote symbol]) Usage
timescale <reference_time_unit>/<time_precision> Example timescale 100 ns/1 ps
AAP
// Description of circuit with delay timescale 1ns/100ps module cir_delay (A,B,C,x,y); input A,B,C; output x,y; wire e; and #(30) g1(e,A,B); or #(20) g3(x,e,y); not #(10) g2(y,C); endmodule
AAP
AAP
AAP
AAP
The End
AAP
Lecture-11
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
1
29-08-07
Objective : Combinational Logic & MSI Components
AAP
Multiplexer
AAP
Multiplexer (Mux)
Mux: Another popular combinational building block
Routes one of its N data inputs to its one output, based on binary value of select inputs
4 input mux needs 2 select inputs to indicate which input to route through 8 input mux 3 select inputs N inputs log2(N) selects
AAP
AAP
i0 (1*i0=i0) 1 0 0
d
i0 (0+i0=i0)
2x1 mux
4 1 i0 i1 i2 i3 s1 s0 d
0 s0
i0 i1 d i2 i3
4x1 mux
s1
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
s0
Mux Example
City mayor can set four switches up or down, representing his/her vote on each of four proposals, numbered 0, 1, 2, 3 City manager can display any such vote on large green/red LED (light) by setting two switches to represent binary 0, 1, 2, or 3 Mayors switches Use 4x1 mux
1 i0 2 i1 i2 3 i3 s1 s0 d Green/ Red LED manager's switches 4x1 on/off
AAP
2 1 i0 d i1 s0
AAP
AAP
Multiplexers
Realize 8 to 1 mux using 4 to 1 mux.
AAP
Multiplexers
Implement 16 to 1 mux using 74HC151s
AAP
Multiplexer Applications
Applications include data selection, data routing, operation sequencing, parallel to serial conversion, waveform generation, and logic function generation.
Data routing Parallel to serial conversion Operation sequencing Logic function generation
AAP
Multiplexer Applications
Parallel to serial conversion
AAP
Realization of a threevariable function using a 8-to-1-line multiplexer. (a) Three-variable truth table. (b) General realization.
AAP
Realization of f(x,y,z) = m(0,2,3,5). (a) Truth table. (b) 8-to-1-line multiplexer realization.
AAP
I0 I4
X
I1 I5
X
I2 I6
X
I3 I7
X
AAP
y
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
I0 I2 I4 I6
I1 I3 I5 I7
AAP
The End
AAP
Lecture-12
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
1
31-08-07
Objective : Combinational Logic & MSI Components
AAP
I0 I2 I4 I6
I1 I3 I5 I7
AAP
AAP
AAP
AAP
Demultiplexer Applications
serial to Parallel conversion
AAP
AAP
AAP
The End
AAP
Behavioral Modeling
AAP
AAP
Structured Procedures
Initial statement Always statement
AAP
Initial statement
module stimulus; reg x,y, a,b, m; Initial m= 1b0; //single statement; does not need to be grouped initial begin #5a =1b1; //multiple statements; need to be grouped #25 b=1b0; end initial begin #10x = 1b0; #25y = 1b1; end initial #50 $finish; endmodule
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Always Statement
module clock_gen (output reg clock); //initialize clock at time zero initial clock = 1b0; //toggle clock every half-cycle (time period =20) always #10 clock =~clock Initial #1000 $finish; endmodule
AAP
Procedural Assignments
Updates values of reg, integer, real or time register variable or a memory element . The value placed on a variable will remain unchanged until another procedural assignment updates the variable with different value. Two types
Blocking Unblocking
AAP
Blocking Assignments
reg x,y,z; reg [15:0] reg_a, reg_b; integer count; //All behavioral statements must be inside an initial or always block initial begin x =0;y =1; // scalar assignments count =0; //Assignment to integer variables reg_a = 16b0; reg_b =reg_a; //initialize vectors #15reg_a[2] =1b1; //Bit selectassignment with delay #10 reg_b[15:13] = {x,y,z} //Assign result of concatenation to //part select of a vector count = count +1; //Assiggnment to an integer (increment) end
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
AAP
Nonblocking Assignments
reg x,y,z; reg[15:0]reg_a,reg_b; integer count; //All behavioral statements must be inside an initial or always block initial begin x =0;y =1;z =1; //Scalar assignments count = 0; //Assignment to integer variables reg_a =16b0; reg_b =reg_a; //Initialize vectors reg_a[2] <=#15 1b1; //Bit select assignment with delay reg_b[15:13]<=#10{x,y,z}; //Assign result of concatenation //to part select of a vector count <= count+1; //Assignment to an integer (increment)
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
AAP
Timing Controls
Delay-Based Timing Control Event-Based Timing Control Level-Sensitive Timing Control
AAP
AAP
AAP
begin If (last_data_packet) //If this is the last data packet ->recevied_data; //trigger the event recevied_data end always@(recevied_data) //Await triggering of event recevied_data
//when event is triggered data in data buffer //use concatenation operator{}
AAP
Event OR control
//A level-sensitive latch with asynchronous reset always@(reset or clock or a) //wait for reset or clock or d to change begin if (reset) //if reset signal is high ,set q to 0. q =1b0; else if(clock) //if clock is high ,latch input q =d; end
AAP
//A level sensitive latch with asynchronous reset always@(reset, clock, d) //Wait for reset or clock or d to change begin if (reset) //if reset signal is high ,set q to 0. q = 1b0; else if(clock) //if clock is high ,latch input q =d; end //A positive edge triggered D flipflop with asynchronous falling //reset can be modeled as shown below always @(posedge clk,negedge reset) //Note use of comma operator if (!reset) q<=0; else q<=d;
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Conditional Statements
if and else case statement casex, casez keywords Loops
while loop for loop repeat loop forever loop
while and forever are not synthesizable only used for simulation
AAP
Behavioral Modeling
AAP
The End
AAP
Lecture-13
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
1
03-09-07
Objective : Digital Integrated Circuits
AAP
Switches
Electronic switches are the basis of binary digital circuits
Electrical terminology
A 5 4 .
A 5 4 .
9V
2 ohms 9V
0V 4.5 A
V = I * R (Ohms Law)
AAP
Switches
A switch has three parts
Source input, and output
Current wants to flow from source input to output
source input output control input control input off
Control input
Voltage that controls whether that current can flow
source input
on output
(b)
IC
quarter (to see the relative size) CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
AAP
Moores Law
IC capacity doubling about every 18 months for several decades
Known as Moores Law after Gordon Moore, co-founder of Intel
Predicted in 1965 predicted that components per IC would double roughly every year or so
AAP
The Diode
AAP
AAP
...attracts electrons here, turning the channel between source and drain into a conductor.
gate
conducts
IC package
(a)
IC
does not conduct conducts
AAP
Logic gates are better digital circuit building blocks than switches (transistors)
Why?...
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
AAP
Logic Families
RTL DTL TTL ECL MOS CMOS Resister-Transistor Logic Diode-Transistor Logic Transistor-Transistor Logic Emitter-coupled Logic Metal-Oxide Semiconductor Complementary Metal-Oxide Semiconductor
AAP
AAP
AAP
AAP
The End
AAP
Lecture-14
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
1
05-09-07
Objective : Digital Integrated Circuits
AAP
Sub families:
74xx : The original TTL family.
These devices had a propagation delay of 10ns and a power consumption of 10mW, and they were introduced in the early 60s.
AAP
AAP
AAP
74Fxx : Fast.
Performance is between 74ASxx and 74ALSxx.
AAP
AAP
AAP
AAP
AAP
AAP
AAP
TTL :
Faster Switching
+5 V
R1
R2
Output A B C Q3 Q1
Now the charge on the base of Q1 is removed through transistor Q3 Results in a considerable reduction in the saturation delay time ts.
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
TTL :
Collector Capacitance
but also increases power dissipation Output circuit of this form known as passive pull-up circuit.
Output capacitance is pulled-up via passive element R2.
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
R1
R2
Output A B C Q3 Q1
AAP
Q2 A B C Q4 Q3 Q1 R1 D1 Output
AAP
Base of Q2 is at 0.9 V
due to VBE of Q1 at 0.7 V and VCE of Q3 at 0.2 V
A B C Q4 Q3
Q2 D1 Output Q1 R1
Because of D1,
emitter of Q2 is more positive than collector of Q3 Q2 is off
+5 V
Q2 A B C Q4 Q3 Q1 R1 D1 Output
As soon as Q3 turns off Q2 conducts as its base is connected to VCC via resistor. Current needed to charge load capacitance causes Q2 to momentarily saturate output voltage rises with a time constant RC
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
AAP
The value of R is << passive pull-up resistance used in the open collector circuit
Metrics
VOH, VOL
VCC = +5 V but due to voltage drops in the output circuit
VOL = 0.2 V (VCE of Q1) VOH = 3.6 V (VCC- (VBE of Q2 +D1)) Speed
Fan-out
8-10
NOTE
High inputs at A, B and C will have to supply a small diode leakage current , IIH = 10 uA If one or more inputs are low, substantial current will flow through input terminal to ground, IIL = 1 mA
AAP
Metrics :
With Q1 on
Vout will be a very low voltage
With Q2 off
No current from +5 V supply through collector resistance. Can only come from inputs to which gate is connected. Q1 performs a current sinking action
With Q2 on
AAP
Q2 supplies input current required by Q4 of other load gates Performs current sourcing actions called the pull-up transistor
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Same output could be generated without Q2 and D1 and connecting resistor to collector of Q1.
with Q2 in circuit no current through collector resistance in low state keeps power dissipation in circuit low.
AAP
AAP
relatively high current 30 40 mA will be drawn from supply. current spike generates noise on power supply distribution line if change in state is frequent power dissipation increases.
AAP
The End
Walter Schottky b. July 23, 1886, Zrich, Switzerland d. March 4, 1976, Pretzfeld, W.Germany
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Lecture-15
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
1
07-09-07
Objective : Digital Integrated Circuits
AAP
Q2 A B C Q4 Q3 Q1 R1 D1 Output
AAP
AAP
1 mW 33 nseconds
AAP
but
6 nseconds 23 mW
AAP
AAP
AAP
AAP
Q3 A B C Q1 Q2 Q4
3.5k
Output Q5
370
350
Q6
AAP
NOTE All transistor are Schottky Transistors. Q4 is not required to be a Schottky as it does not saturate but stays in active region
AAP
AAP
This is the mainstay of the TTL family Found in nearly all new designs that do not require max speed.
AAP
8 mW 1.7 nseconds
AAP
This series has the lowest speed-power product of the TTL series very close to the lowest gate power dissipation (c.f. 74L) This will eventually replace 74LS as the most widely used TTL series.
AAP
74L 33 1
74H 6
23
74S 3
20
74LS 9.5
2
74AS 1.7
8
74 ALS 4
1.2
10
Speed Power (pJ) Max Clock rate (MHz) Fan-out (same series)
90
33
138
60
19
13.6
4.8
35 10
3 20
50 10
125 20
45 20
200 40
70 20
Voltage Parameters
AAP
All of the performance ratings are for a NAND gate in each series.
Tri-State Devices
This kind of device include a third electrical state called high impedance or Hi-Z. This new state is controlled by an input control line called output enable. When this input is asserted the device behaves like a normal gate, otherwise, the output behaves like an open circuit.
AAP
Tri-state Inverter
AAP
Tri-State Devices
One application of tri-state devices is to be used to connect several devices to a single bus. When changing which output is connected to bus one must ensure that all outputs must first go into the hi-Z state thus avoiding the possibility that two outputs would be connected to the bus simultaneously.
AAP
AAP
Sub-families:
40xx : Original CMOS family.
Fairly slow, but it has a low power dissipation.
AAP
AAP
Logic Families
Sub-families:
74FCTxx : Fast CMOS, TTL compatible.
It is faster and has lower power dissipation than the 74ACxx and 74ACTxx sub-families. Compatible with TTL family.
AAP
Logic Families
Prefixes, usually added to device designation to identify the manufacturer.
SN : Texas Instrument. MN : Motorola. DM : National N : Signetics P : Intel H : Harris AMD : Advanced Micro Devices
AAP
AAP
AAP
Bilateral Switch
AAP
AAP
AAP
Components of a Simulation
Design Block Stimulus Block
AAP
Test Bench
AAP
//designblock module mm(a,b,s, o); input a,b,s; output o; assign o=s ? a:b; endmodule
//stimulus block module testmux; reg ta,tb,ts; wire y; mm mux (ta,tb,ts,y); //instantiate mux initial begin ts=1;ta=0;tb=1; #10 ta=1;tb=0; #10 ts=0; #10 ta=0;tb=1; end initial $monitor("s=%b a=%b b=%b o=%b time=%0d", ts,ta,tb,y,$time); endmodule
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
The End
Walter Schottky was a German physicist whose research in solid-state physics and electronics yielded many effects and devices that now bear his name (Schottky effect, Schottky barrier, Schottky diod).
Walter Schottky b. July 23, 1886, Zrich, Switzerland d. March 4, 1976, Pretzfeld, W.Germany
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Lecture-16
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
10-09-07
Objective : Sequential Logic,
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Sequential Circuits
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Introduction
Sequential circuit
Output depends not just on present inputs (as in combinational circuit), but on past sequence of inputs
Stores bits, also known as having state
a b 1 1 0 Combinational digital circuit F
a b
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Cancel button
Press cancel: light turns off Logic gate circuit to implement this?
Call Cancel Q
Doesnt work. Q=1 when Call=1, but doesnt stay 1 when Call returns to 0 Need some form of feedback in the circuit
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
S t
S 1 0 t
1Q
S 1 1 t
1Q
S 0 1 t
1Q
S t Q
1 0 1 0 1 0
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
S (set)
SR latch
Recall
1
1 X
0 Q
0 Q
1 0 R1 0 t 1 0 1 Q 0
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Cancel=1 : resets Q to 0
Blue ligt h Q R
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
0 R=1
0 Q R=0
1 Q R=0
0 Q
Q may oscillate. Then, because one path will be slightly longer than the other, Q will eventually settle to 1 or 0 but we dont know which.
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
t Q
1 0 1 0
X 0 1 Y
Q Y R
0 1 S
The longer path from X to R than to S causes SR=11 for short time could be long enough to cause oscillation
R
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
0 SR= 11 1 0
SR NOR Latch
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Change C to 1 only after sufficient time for S and R to be stable When C becomes 1, the stable S and R value passes through the two AND gates to the SR latchs S1 R1 inputs.
Level-sensitive SR latch X S
C Q R R1
S
C R
Q Q
S1
1 R0
Clk C
C
Q R R1
1 0
1
S1
0
1
R1 0
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
...S1R1 never = 11
Clk
Sequential circuit whose storage components all use clock signals: synchronous circuit
Most common type Asynchronous circuits important topic, but left for advanced course
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Clocks
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
The End
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Lecture-17
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
12-09-07
Objective :Synchronous Sequential Logic
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Change C to 1 only after sufficient time for S and R to be stable When C becomes 1, the stable S and R value passes through the two AND gates to the SR latchs S1 R1 inputs.
Level-sensitive SR latch X S
C Q R R1
S
C R
Q Q
S1
1 R0
Clk C
C
Q R R1
1 0
1
S1
0
1
R1 0
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
...S1R1 never = 11
Clk
Sequential circuit whose storage components all use clock signals: synchronous circuit
Most common type Asynchronous circuits important topic, but left for advanced course
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Clocks
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Level-Sensitive D Latch
SR latch requires careful design to ensure SR=11 never occurs D latch relieves designer of that burden
Inserted inverter ensures R always opposite of S
D 1 0 1 0 1 0 1 0 1 0
D C Q Q
D latch S
C Q R
D latch symbol
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
rising edges
Q1
D2 C2
Q2
D3 C3
Q3
D4 C4
Q4
Clk
Clk_B
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
D Flip-Flop
Flip-flop: Bit storage that stores on clock edge, not level One design -- master-servant (master-slave)
Two latches, output of first goes to input of second, master latch has inverted clock signal So master loaded when C=0, then servant when C=1 When C changes from 0 to 1, master disabled, servant loaded with value that was at D just before C changed -- i.e., value at D during rising edge of C
D flip-flop D latch D Dm Cm master Clk
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
rising edges
Clk
Clk D/Dm Cm
D latch Ds Cs Qs Qs
Qm
Q Q
Qm/Ds Cs Qs
servant
D Flip-Flop
D
The triangle means clock input, edge triggered
Q Q
Q Q
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
D Flip-Flop
Solves problem of not knowing through how many latches a signal travels when C=1
In figure below, signal travels through exactly one flip-flop, for Clk_A or Clk_B Why? Because on rising edge of Clk, all four flip-flops are loaded simultaneously -- then all four no longer pay attention to their input, until the next rising edge. Doesnt matter how long Clk is 1.
T n i s e a d c h
D1
Q1
D2
Q2
D3
Q3
D4
Q4
i l f
l o
o l p f
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
4 7
6 8
Q (D flip-flop)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
10
Blue light
Preserve value: if Q=0, make D=0; if Q=1, make D=1 Cancel -- make D=0 Call -- make D=1 Lets give priority to Call -- make D=1
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Circuit derived from truth table, using Chapter 2 combinational logic design process
Call button
Call
Cancel
button
Cancel
Clk
Blue light
Feature: S and R only have effect when C=1. We can design outside circuit so SR=11 never happens when C=1. Problem: avoiding SR=11 can be a burden.
Feature: SR cant be 11 if D is stable before and while C=1, and will be 11 for only a brief glitch even if D changes while C=1. Problem: C=1 too long propagates new values through too many latches: too short may not enable a store.
Feature: Only loads D value present at rising clock edge, so values cant propagate to other flip-flops during same clock cycle. Tradeoff: uses more gates internally than D latch, and requires more external gates than SR but gate count is less of an issue today.
We considered increasingly better bit storage until we arrived at the robust D flip-flop bit storage
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
More on Flip-Flops
Other flip-flop types
SR flip-flop: like SR latch, but edge triggered JK flip-flop: like SR (S J, R K)
But when JK=11, toggles 1 0, 0 1
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
SR Flip-Flop
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
D Flip-Flop
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
JK Flip-Flop
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
T Flip-Flop
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
AR
AS
cycle 1 clk
cycle 2
cycle 3
cycle 4
D AR
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Q Q
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Basic Register
Typically, we store multi-bit items
e.g., storing a 4-bit binary number
I3 I2 I1 I0 reg(4)
Q3 Q2 Q1 Q0
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
t u
r o s n e
e m p
x4 x3 x2 x1 x0 C
a4 a3 a2 a1 a0
b4 b3 b2 b1 b0
c4 c3 c2 c1 c0
TemperatureHistoryStorage
timer
(In practice, we would actually avoid connecting the timer output C to a clock input, instead only connecting an oscillator output to a clock input.)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
x4...x0 C Ra Rb Rc
15 18 20 21 21 22 24 24 24 25 25 26 26 26 27 27 27 27
0 0 0
18 0 0
21 18 0
24 21 18
25 24 21
26 25 24
27 26 25
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
The End
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Lecture-18
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
14-09-07
Objective :Synchronous Sequential Logic
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Registers
Can store data, very common in datapaths Basic register : Loaded every cycle
Useful for implementing FSM -- stores encoded state For other uses, may want to load only on certain cycles
b Combinational n1 logic n0 s1 s0 clk State register x
load
clk
I3
I2
I1
I0 4-bit register
D Q
D Q
D Q
D Q
i s
a n s i
I3 I2 I1 I0 reg(4)
Q3 Q2 Q1 Q0
Q3 Q2 Q1 Q0
e
Basic register loads on every clock cycle How extend to only load on certain cycles?
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
load = 0
1 0 D Q Q3
load = 1
1 0 D Q Q3
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
This example will show how registers load simultaneously on clock cycles
Notice that all load inputs set to 1 in this example -- just for demonstration purposes
R0 Q3 Q2 Q1 Q0
ld I3
I2
I1
I0 R1
1 ld I3
I2
I1
I0 R2
Q3 Q2 Q1 Q0
Q3 Q2 Q1 Q0
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
given
2 1010
R 0 R 1 R 2
a3 a2 a1 a0 1 ld I3 I2 I1 I0
>1111 ???? R 0
clk
R0
Q3 Q2 Q1 Q0
(b)
1010 R 0
???? R 1
1 ld I3 I2 I1 I0 1 ld I3 I2 I1 I0
???? R 2
???? R 1
???? R 2
1111 R 1
0000 R 2
0001 R 1
1110 R 2
1010 R 1
0101 R 2
1010 R 1
0101 R 2
R1
Q3 Q2 Q1 Q0
R2
Q3 Q2 Q1 Q0
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
0011 0
Save 2 3 pounds Present weight b clk
load
I3 I2 I1 I0 Q3 Q2 Q1 Q0
0011
a4 a3 a2 a1 a0
a4 a3 a2 a1 a0
b4 b3 b2 b1 b0 I4 Q4 I3 Q3 I3 Q3 I2 Q2 I2 RbQ2 I1 Q1 I1 Q1 I0 Q0 I0 Q0 Rb
b4 b3 b2 b1 b0
I4 Q4 I3 Q3 I3 Q3 I2 Q2 Q2 I2 Rc I1 Q1 I1 Q1 I0 Q0 I0 Q0 Rc
c4 c3 c2 c1 c0
c4 c3 c2 c1 c0
t4 x4 t3 x3 t2 x2 t1 x1 t0
x0
I4 Q4 I4 Q4 I3 Q3 I3 Q3 I2 Q2 I2 Ra Q2 I1 Q1 I1 Q1 I0 Q0
I0 Q0
I4
Q4
I4
Q4
ld
Ra
ld
ld
TemperatureHistoryStorage
new line
TemperatureHistoryStorage
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
0001010
e r t
8 d0 2 4 a0
p o u m
a l
t o h m e a 'c s r
Lecture-11 example: Four simultaneous values from cars computer To reduce wires: Computer writes only 1 value at a time, loads into one of four registers
Was: 8+8+8+8 = 32 wires Now: 8 +2+1 = 11 wires
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
0 1
d1 i0 i1 d2
8 load reg1
i0 8-bit 41
0001010
A 8
i1 d i2 8
a1
load reg2
I 8
load
d3
load reg3
M 8 i3 s1 s0 x y
8
a b h e t o r r o d s r i p l o v a e y
R6 d6 e
R5 d5
R4
R3
R2
R1
R0
Q I
R0
load
10100010
d4 d3 i2 i1 i0
d2 d1 d0 3 8 decoder
(a)
R7
R6
R5
R4
R3
R2
R1
R0
D i2,i1,i0 e clk
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Shift Register
Shift right
Move each bit one position right Shift in 0 to leftmost bit
1 1 0 1 0 0 1 1 0 Register contents before shift right Register contents after shift right
Q: Do four right shifts on 1001, showing value after each shift A: 1001 (original) 0100 0010 0001 0000
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Shift Register
To allow register to either shift or retain, use 2x1 muxes
shr: 0 means retain, 1 shift shr_in: value to shift in
May be 0, or 1
Note: Can easily design shift register that shifts left instead
shr_in shr 1 0 2 1 D Q Q3 1 0
shr=1
1 0
1 0
1 0 2 1 D Q
1 0 D Q Q2 (b)
1 0 D Q Q1
1 0 D Q Q0
D Q Q2 (a)
D Q Q1
D Q Q0
Q3
shr_in shr Q3
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Q2 (c)
Q1
Q0
Rotate Register
1 1 0 1 Register contents before shift right Register contents after shift right
Rotate right: Like shift right, but leftmost bit comes from rightmost bit
1 1 1 0
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
8 load reg0 T
Earlier example: 8 +2+1 = 11wires from cars computer to above-mirror displays four registers
Better than 32 wires, but 11 still a lot -want fewer for smaller wire bundles
d0
2 4 d1 load reg1 A
a0
i0
a1
i1
d2
e load
d3
load
reg3
M 8 i3 s1 s0 x y
Note: this line is 1 bit, rather than 8 bits like before x y c shr_in shr reg0 d0 T s1 s0 i0 2 4 8 shr_in 41 shr reg1 d1 A a0 i0 i1 8 i1 a1 shr_in d shr reg2 d2 8 I i2 e d3 shr_in shr reg3 8 M i3 8
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
shift
Multifunction Registers
Many registers have multiple functions
Load, shift, clear (load all 0s) And retain present value, of course
Functions:
s1 0 0 1 1
I0 0 3210 shr_in s1 s0 I3 I2 I1 I0
s0 0 1 0 1
Operation Maintain present value Parallel load Shift right (unused - let's load 0s)
I2 0 3210
I1 0 3210
D Q Q2 (a)
D Q Q1
D Q Q0
Q3 Q2 Q1 Q0
(b)
Multifunction Registers
s1 0 0 1 1 s0 0 1 0 1 Operation Maintain present value Parallel load Shift right Shift left
I3 shr_in
I2
I1
I0 shl_in
3210
3210
3210
I3
I2
I1
I0
D Q Q3
D Q Q2 (a)
D Q Q1
D Q Q0
Q3 Q2 Q1 Q0
(b)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
I3 shr_in s1 s0 I3
I2 I2
I1 I1
I0 I0 shl_in
shl_in Q3 Q2 Q1 Q0 Q3 Q2 Q1 Q0
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Put highest priority control input on left to make reduced table simple
Inputs shr shl ld 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 Outputs s1 s0 0 1 1 1 0 0 0 0 0 1 0 0 1 1 1 1 Note Operation Maintain value Shift left Shift right Shift right Parallel load Parallel load Parallel load Parallel load ld 0 0 0 1 shr 0 0 1 X shl 0 1 X X Operation Maintain value Shi t left f Shift right Parallel load
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
1 0
s2 s1 s0
In from Qn-1
7 6 5 4 3 2 1 0 D Q Qn
Step 2: Create mux operation table Step 3: Connect mux inputs Step 4: Map control lines
s2 = clr*set s1 = clr*set*ld*shl + clr s0 = clr*set*ld + clr
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
shl 0
1 X
Outputs s2 s1 s0 0 0 0
0 0 1 0 0 1
0 1
1 X
X X
X X
1 0
0 1
0 1
shl_in Q3 Q2 Q1 Q0 Q3 Q2 Q1 Q0
clr 0
0 0
Inputs set ld 0 0
0 0 0 1
shl 0
1 X
Outputs s2 s1 s0 0 0 0
0 0 1 0 0 1
0 1
1 X
X X
X X
1 0
0 1
0 1
The End
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Lecture-19
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
17-09-07
Objective :Synchronous Sequential Logic
Counters
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Counters
Synchronous Counters Ripple Counters Counter with unused states or Self Correcting Counters Counters based on Shift Registers
Ring Counter Johnson Counter
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Ring Counter
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
DC = (A+C)B
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Ripple Counters
The Flip-Flop output transition serves as a source for triggering other Flip-Flops All Flip-Flops are not triggered by same clock
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
The End
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Syntax initial begin block of statements end always@(event control expn) begin block of statements end
Keywords for positive and negative edge trigering posedge and negedge
D Latch
module Latch(Q,D,EN); output Q; input D,EN; reg Q; always@(EN,D) if(EN) Q=D; endmodule
D -FLIP FLOP
module DFF(Q,D,CLK); output Q; input D,CLK; reg Q; always@(posedge CLK) Q=D; endmodule
T ff from DFF
module Tff(Q,T,CLK,RST); output Q; input T,CLK,RST; wire DT; assign DT = Q^T; DFF (Q,DT,CLK,RST); endmodule
Sequential statements
PARALLEL BLOCKS
Keyword fork and join All statement execute concurrently inside the initial statement initial fork x=1bo; //completes at time 0 #5 y = 1b1; // completes at time 5 #10 z = {x,y}; //completes at time 10 join
Counter counts 0 to N.
Shift registers
8 bit shift registers It shifts 1 bit right when r_l =1 other wise it shifts left Barrel shifter
Lecture-21
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
28-09-07
Objective :Synchronous Sequential Logic
Counters
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Counters
Synchronous Counters Ripple Counters Counter with unused states or Self Correcting Counters Counters based on Shift Registers
Ring Counter Johnson Counter
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
COUNTER TYPES
Asynchronous Counter (a.k.a. Ripple or Serial Counter): each FF is triggered one at a time with output of one FF serving as clock input of next FF in the chain. Synchronous Counter (a.k.a. Parallel Counter): all the FFs in the counter are clocked at the same time. Up Counter: counter counts from zero to a maximum count. Down Counter: counter counts from a maximum count down to zero. BCD Counter: counter counts from 0000 to 1001 before it recycles. Pre-settable Counter: counter that can be preset to any starting count either synchronously or asynchronously Ring Counter: shift register in which the output of the last FF is connected back to the input of the first FF. Johnson Counter: shift register in which the inverted output of the last FF is connected to the input of the first FF.
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Synchronous Counters
N-bit up-counter: N-bit register that can increment (add 1) to its own value on each clock cycle
0000, 0001, 0010, 0011, ...., 1110, 1111, 0000 Note how count rolls over from 1111 to 0000
Terminal (last) count, tc, equals1 during value just before rollover
cnt ld 4-bit register
1 0
cnt
4-bit up-counter tc C 4
0 0 1
0101 0100 0011 0010 0001 0000 0001 0000 1111 1110 ...
4-bit up-counter
Internal design
Register, incrementer, and N-input AND gate to detect terminal count
tc
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
4 4 C
4 +1 4
Incrementer
Counter design used incrementer Incrementer design
Could use carry-ripple adder with B input set to 00...001
But when adding 00...001 to another number, the leading 0s obviously dont need to be considered -- so just two bits being added per column
Use half-adders (adds two bits) rather than full-adders (adds three bits)
a3 a2 a b HA co s s2 (a) a1 a b HA co s s1 a0 1 a3 a2 a1 a0 +1 co s3s2 s1 s0 (b)
carries:
a b HA co s co s3
a b HA co s s0
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Incrementer
Can build faster incrementer using combinational logic design process
Capture truth table Derive equation for each output
c0 = a3a2a1a0 ... s0 = a0
Inputs a3 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 a2 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 a1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 a0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 c0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 Outputs s3 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 s2 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 s1 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 s0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
Results in small and fast circuit Note: works for small N -- larger N leads to exponential growth, like for N-bit adder
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
mode
cnt tc
clk
x y
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
cnt
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Down-Counter
4-bit down-counter
1111, 1110, 1101, 1100, , 0011, 0010, 0001, 0000, 1111, Terminal count is 0000
Use NOR gate to detect
cnt ld 4-bit register 4-bit down-counter
4 4 C
4 1 4
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Up/Down-Counter
Can count either up or down
Includes both incrementer and decrementer Use dir input to select, using 2x1: dir=0 means up Likewise, dir selects appropriate terminal count value
dir 4-bit up/down counter
4-bit 2 x 1 0 4
clr cnt
clr ld
4-bit register
4 4
4 1 4
4 +1 4
1 2x 1 0 tc
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
0 0 1 0 0 1
i2 i1 i0
d7 d6 d5 d4 d3 d2 d1 d0
lights
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
cnt
ld 4-bit register
4 4 tc C
4 +1
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
1000
4
4-bit down-counter
tc 4 C
clk
9 counts
0 1 1 1
X 1 0 0
X X 1 0
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Counter Example:
New Years Eve Countdown Display
Above example previously used microprocessor to counter from 59 down to 0 in binary Can use 8-bit (or 7- or 6-bit) down-counter instead, initially loaded with 59
59 8 L ld reset c0 c1 c2 c3 c4 c5 c6 c7 i0 i1 i2 i3 i4 i5 d0 d1 d2 d3 0 1 2 3 Happy New Year
58 59
fireworks
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Counter Example:
1 Hz Pulse Generator from 60 Hz Clock
U.S. electricity standard uses 60 Hz signal
Device may convert that to 1 Hz signal to count seconds
1 osc (60 Hz) clr cnt 6-bit up counter tc p C
(1 Hz)
59 in binary 111011
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Timer
A type of counter used to measure time
If we know the counters clock frequency and the count, we know the time thats been counted
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
IC ASYNCHRONOUS COUNTERS
Logic Diagram for 7493
___ CPo ___ CP1 MR1 MR2 Qo (LSB) Q1 Q2
*All J, K inputs internally connected HIGH
___ CP1 ___ CPo
J Q CP K QN R
J Q CP K QN R
J Q CP K QN R
J Q CP K QN R
Q3 (MSB)
7493
MR1 MR2
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Q3
Q2
Q1
Qo
Q3 (MSB)
7493
MR2 Q3 Q2 Q1 Qo
MR1
F= 10 kHz/16 = 625 Hz
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
TEST
Build a MOD 10 counter with a 7493
___ CPo ___ CP1 MR1 MR2 Qo (LSB) Q1 Q2
*All J, K inputs internally connected HIGH J Q CP K QN R J Q CP K QN R J Q CP K QN R J Q CP K QN R
Q3 (MSB)
7493
MR2 Q3 Q2 Q1 Qo
10 kHz
MR1
F= 10 kHz/10 = 1KHz
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
BCD COUNTER
Binary counter that counts from 0000 to 1001 before it recycles (MOD-10). Widespread applications where pulses or events are to be counted and the results displayed on a decimal numerical read-out. Also used for dividing a pulse frequency exactly by 10.
Hundreds
BCD counter D C B A D
Tens
BCD counter C B A D
Units
BCD counter C B A
Input
Decoder/display 0-9
Decoder/display 0-9
Decoder/display 0-9
MOD-60 COUNTER
MOD 6 MOD 10
7493
MR2 Q3 Q2 Qo not used
7493
MR2 Q3 Q2 Qo
fin
fout = fin/60
fin/10
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
DIGITAL CLOCK
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
What happens if we fall in unused states? In this case, 111 results in 000. 011 results in 100. The Counter is self-correcting.
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Present State A B C 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 1 0
Next State A B C 0 0 1 0 1 0 1 0 0 1 0 1 1 1 0 0 0 0
Flip-Flop Inputs JA KA JB KB JC KC 0 X 0 X 1 X 0 X 1 X X 1 1 X X 1 0 X X 0 0 X 1 X X 0 1 X X 1 X 1 X 1 0 X
The End
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Lecture-22
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
01-10-07
Objective :Analysis of Clocked Sequential Circuits, FSM (Finite State Machine) and Controller Design
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Models
The Synchronous or Clocked sequential circuits are represented by two models
Mealy circuit: The output depends on both the present state of the flipflop(s) and on the input(s). Moore Circuit: The output depends only on the present state of the flip-flop(s)
a) Its output is a a) Its output is a function of function of present state as present state well as present only input b) Input changes b) Input changes does not affect may affect the the output output c) It requires more c) It requires less number of states number of states for implementing for implementing same function. same function.
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Mealy Machine
Q + = f ( X , Q)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Z = g ( X , Q)
Moore Machine
Q + = f ( X , Q)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Z = g (Q )
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
E x ita tio n e x p re s s io n s D 1 = x Q 2 + Q 1Q 2 D 2 = x Q 1 + Q 2Q 2
Output expressions z= xQ1 + xQ1 Q 2
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
+ 1
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
(Q1+ Q2+)
Input (x)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
(Q1+ Q2+)
Input (x)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
E x ita tio n e x p re s s io n s J1 = y , K1 = y + xQ 2
J 2 = x Q 1 + x y Q1 , K 2 = x y + y Q 1
Output expressions
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
z1 = Q1 Q 2 z 2 = Q1 + Q 2
Output (z)
00 01 10 11
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
00 10 01 01 11 00 10 01 00 11 00 10
01 00 11 01
Output (z)
00,00 11,00 01,11 00,00 11,00 00,11 00,00 11,11 01,01 00,00 11,11 00,01
01 00 11 01
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
0 A 0
0 C 1
1 C 0
1 A 1
0 B 0
1 D 0
1 A 1
1 B 0
0 D 1
1 A 1 B
Output seq.
The End
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Lecture-23
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
03-10-07
Objective :FSM (Finite State Machine) and Controller Design
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Controller Design
Five step controller design process
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
b clk
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
clk^
x=1 On
cycle 1
cycle 2
cycle 3
cycle 4
Off
On
Off
On
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
x=1 On2
clk^
x=1 On3
Inputs: b; Outputs: x
x=0 Off b*clk ^ x=1 clk^ On1 b *clk^ clk^
x=1 On2
clk^
x=1 On3
Inputs: b; Outputs: x x=0 Off b x=1 On1 x=1 On2 x=1 On3 b
FSM Definition
FSM consists of
Set of states
Ex: {Off, On1, On2, On3}
Inputs: b; Outputs: x x=0 Off b x=1 On1 x=1 On2 x=1 On3 b
Initial state
Ex: Off
Set of transitions
Describes next states Ex: Has 5 transitions
Set of actions
Sets outputs while in states Ex: x=0, x=1, x=1, and x=1
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Inputs: a; Outputs: r
FSM
Wait until computer requests ID (a=1) Transmit ID (in this case, 1101)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
FSM
Wait for start (s=1) in Wait Once started (Start)
If see red, go to Red1 Then, if see blue, go to Blue Then, if see green, go to Green Then, if see red, go to Red2
In that state, open the door (u=1) Wait u=0 s Start u=0 ar Red1 u=0 ab a Blue u=0 ag a s a ar ab ag
Green u=0
ar a
R ed2 u=1
Q: Can you trick this FSM to open the door, without knowing the code? A: Yes, hold all buttons simultaneously
New transition conditions detect if wrong button pressed, returns to Wait FSM provides formal, concrete means to accurately define desired behavior
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Inputs: b; Outputs: x x=0 Off b x=1 On1 x=1 On2 x=1 On3 b
s p u o t
FSM inputs
Known as controller
FSM inputs I
O Combinational logic
S
m
m
clk
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
General version
FSM outputs
FSM outputs
M S F
O Combinational logic
S
m
m
General version
Flip-Flops
FSM outputs
The End
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Lecture-24
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
05-10-07
Objective :FSM (Finite State Machine) and Controller Design
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
x x S2 y=0
S1
x x S3 y=1
S2
x x S0 y=0 S1 y=1
S1
state x y
S2
state x y
x
S0
S1
S0
S0
For the same sequence of inputs, the output of the two FSMs is the same
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
2. AND, for all possible sequences of inputs, the FSM outputs will be the same starting from either state
e.g. say x=1,1,0,0,
starting from S1, y=1,1,0,0, starting from S3, y=1,1,0,0,
S0, S2 y=0
x x S1, S3 y=1
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
From S3, when x=0, go to S0 where y=0 y=0 y=1 Outputs differ, so S1 and S3 are not Start from S3, x=0 equivalent.
x S0
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
x x S1 y=1
y=0
S0 S1 S2 S3 S0 S1 S2 S3 Diagonal Redundant
To compare every pair of states, construct a table of state pairs (above right) Remove redundant state pairs, and state pairs along the diagonal since a state is equivalent to itself (right)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
S1 S2 S3 S0 S1 S2
S1 S2 S3 S0 S1 S2
We can see that S2 & S0 might be equivalent and S3 & S1 might be equivalent, but only if their next states are equivalent (remember the example from two slides ago)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
S1 S2 S3 S0
(S3, S1) (S2, S0) (S3, S1) (S0, S2)
(S3, S1)
By a similar process, we add the next state pairs (S3, S1) and (S0, S2)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
S1
S2
S1 S2 S3 S0
(S3, S1) (S2, S0) (S3, S1) (S0, S2)
(S3, S1)
Next state pair (S3, S1) is not marked Next state pair (S0, S2) is not marked So we do nothing and move on
S1
S2
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
S1 S2
(S3, S1) (S2, S0) (S3, S1) (S0, S2)
S3 S0
S1
S2
y=0
y=1
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
S1 S2 S3 S0 S1 S2
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
S1 S2 S3 S0
(S2, S2) (S3, S1)
x=0 x=1
S1
S2
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
S1 S2 S3 S0
(S2, S2) (S3, S1) (S0, S2) (S0, S2) (S3, S1) (S3, S3)
S1
S2
Step 1: Mark state pairs having different outputs as nonequivalent Step 2: For each unmarked state pair, write the next state pairs for the same input values Step 3: For each unmarked state pair, mark state pairs having nonequivalent next state pairs as nonequivalent.
Repeat this step until no change occurs, or until all states are marked.
Step 1: Mark state pairs having different outputs as nonequivalent Step 2: For each unmarked state pair, write the next state pairs for the same input values Step 3: For each unmarked state pair, mark state pairs having nonequivalent next state pairs as nonequivalent.
Repeat this step until no change occurs, or until all states are marked.
x SG z=0
100 states would have table with 100*100=100,000 state pairs cells State reduction typically automated
Often using heuristics to reduce compute time
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
The End
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Lecture-25
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
08-10-07
Objective :FSM (Finite State Machine) and Controller Design
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Controller Design
Five step controller design process
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
s p u o t
FSM inputs
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
FSM outputs
M S F
FSM outputs
FSM inputs
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
n1 = s1s0b + s1s0b + s1s0b + s1s0b n1 = s1s0 + s1s0 n0 = s1s0b + s1s0b + s1s0b n0 = s1s0b + s1s0
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
FSM inputs
b
b
n S i p F M u t s
Combinational Logic x
FSM outputs
x Combinational n1 logic n0 s1 s0
n1
clk
State register
n0
s1 clk
s0
State register
x=0 b x=1
10 On2 00 Off
x=0 b x=1
10 On2 00 Off
b x=1
10 On2
x=1
01 On1
x=1
11 On3
x=1
01 On1
x=1
11 On3
x=1
01 On1
x=1
11 On3
b 0
0 0 0 0 0
x 0 n1 0
b 1
0 0 0 0 1
x 0 n1 0
b 1
0 1 1 0 0
x 1 n1 1 n0 0
n0 1 0 clk s1 0 1 s0 1 0 state=01
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
State Encoding
Encoding: Assigning a unique bit representation to each state Different encodings may optimize size, or tradeoff size and performance Consider 3-Cycle Laser Timer
Binary encoding: 15 gate inputs Try alternative encoding
x = s1 + s0 n1 = s0 n0 = s1b + s1s0 Only 8 gate inputs 1 1 0 0
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Inputs: b; Outputs: x x=0 00 b x=1 01 On1 x=1 11 10 On2 x=1 10 11 On3 Off b
1 1 0 0
Smaller
3+0+0+2+(2+2) = 9 gate inputs Earlier binary encoding : 15 gate inputs
Faster
Critical path: n0 = s0*b + s3 Previously: n0 = s1s0b + s1s0 2-input AND slightly faster than 3-input AND
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
B 01 0010 x=1
C 10 0100 x=1
Fewer gates and only one level of logic less delay than two levels, so faster clock frequency
8 binary 6 4 one-hot 2
clk n1
s2
s1
s0
State register n0 n1
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
1 2 3 4 delay (gate-delays)
n2
n3
Output Encoding
Output encoding: Encoding method where the state encoding is same as the output values
Possible if enough outputs, all states with unique output values
Use the output values as the state encoding
Inputs: none; Outputs: x,y xy=00 A 00
xy=01 D 11
B 01 xy=11
C 10 xy=10
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
B wxyz=0011
C wxyz=1100
s3 s2 s1 s0
clk
State register
n2 n1 n0
Use output values as state encoding Create state table Derive equations for next state
n3 = s1 + s2; n2 = s1; n1 = s1s0; n0 = s1s0 + s3s2
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
n3
Controller Example:
Button Press Synchronizer
clk Inputs: bi cycle1 cycle2 cycle3 cycle4
bi
bo
Outputs: bo
Want simple sequential circuit that converts button press to single cycle duration, regardless of length of time that button actually pressed
We assumed such an ideal button press signal in earlier example, like the button in the laser timer controller
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Controller Example:
Button Press Synchronizer (cont)
FSM inputs: bi; FSM outputs: bo bi A bo=0 bi B bo=1 bi bi bi C bi bo=0
clk bi Combinational logic s1 s0 bo n1 n0 n1 = s1s0bi + s1s0bi n0 = s1s0bi bo = s1s0bi + s1s0bi = s1s0 Combinational logic bo
M S F s p u o t
FSM outputs
FSM inputs
State register
Step 1: FSM
Combinational logic Inputs Outputs s1 s0 bi n1 n0 bo 0 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 1 0 0 1 1 1 0 1 1 0 0 0 0 0 1 0 1 1 0 0 1 1 0 0 0 0 1 1 1 0 0 0
bi
n1
A B C unused
n0
s1 clk
s0 State register
w x y z n1 n0
00 01
11 10
B wxyz=0011
C wxyz=1100
clk
State register
C wxyz=1100
clk
s0 State register
n0
n1
Step 1
a
S F M
r
Combinational logic
S F M
Step 2
s t u p i n
n2 n1
n0
s2 s1 s0
clk
State register
Inputs:a;Outputs:r
000
r=0
Step 3
001
r=1
010
r=1
011
r=0
100
r=1
Step 4
y z
states
D C
n1 n0 s1 clk s0
State register
x
yz=10 D yz=00
Work backwards
Pick any state names you want
D yz=00
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
a ab
ab a ab ab what if ab=00?
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Only one condition true: AND of each condition pair (for transitions leaving a state) should equal 0 proves pair can never simultaneously be true One condition true: OR of all conditions of transitions leaving a state) should equal 1 proves at least one a + ab = a*(1+b) + ab condition must be true = a + ab + ab = a + (a+a)b Example
a ab
Q: For shown transitions, prove whether: * Only one condition true (AND of each pair is always 0) * One condition true (OR of all transitions is always 1)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Consider transitions of state Start, and the only one true property
Red1 u=0
Fails! Means that two of Starts (likewise for ab, ag, ar) transitions could be true Note: As evidence the pitfall is common,
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
ar * a(r+b+g) Intuitively: press red and blue = (a*a)*(r+b+g) = 0*(r+b+g) buttons at same time: conditions = (a*a)*r*(r+b+g) = a*r*(r+b+g) ar, and a(r+b+g) will both be true. Which one should be = arr+arb+arg taken? = 0 + arb+arg Q: How to solve? = arb + arg = ar(b+g) A: ar should be arbg
we admit the mistake was not intentional. A reviewer of the book caught it.
Simplifying Notations
FSMs
Assume unassigned output implicitly assigned 0
a=0 b=1 c=0 a=0 b=0 c=1
clk a
Sequential circuits
Assume unconnected clock inputs connected to same external clock
b=1 c=1
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
C D S 2 3 4 7 5 6 1
hold time
Leads to oscillation!
Metastability
Violating setup/hold time can lead to bad situation known as metastable state
Metastable state: Any flip-flop state other than stable 1 or 0
Eventually settles to one or other, but we dont know which
clk D
For internal circuits, we can make sure observe setup time But what if input comes from external (asynchronous) source, e.g., button press?
Partial solution
Insert synchronizer flip-flop for asynchronous input
Special flip-flop with very small setup/hold time
ai
synchronizer
Metastability
One flip-flop doesnt completely solve problem How about adding more synchronizer flip-flops?
Helps, but just decreases probability of metastability
low ai
synchronizers
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
AR
AS
cycle 1 clk
cycle 2
cycle 3
cycle 4
D AR
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Q Q
reset
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Glitching
Glitch: Temporary values on outputs that appear soon after input changes, before stable new output values Designer must determine whether glitching outputs may pose a problem
If so, may consider adding flipflops to outputs
Delays output by one clock cycle, but may be OK
clk
s p u o t M S F
b
n S i p F M u t s
Combinational Logic x
n1
n0
s1
s0
State register
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
The End
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Lecture-26
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
10-10-07
Objective : Modular approach for CPU design Register-Transfer Level (RTL) Design
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Introduction
U Know: Controllers
Control input/output: single bit (or just a few) representing event or state Finite-state machine describes behavior; implemented as state register and combinational logic
bi bo Combinational logic n1 s1 clk s0 n0 FSM outputs FSM inputs
State register
ALU
e
bi
bo
Datapath Controller
Capture behavior
Convert to circuit
a 25
50
25
0 1 0
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Inputs: c (bit), a (8 bits), s (8 bits) Outputs: d (bit) Local registers: tot (8 bits) c Add Init d=0 tot=0 Wait tot=tot+a c*(tot<s) c*(tot<s) Disp d=1
In Wait state, if tot >= s, go to Disp(ense) state Disp state: Set d=1 (dispense soda)
Return to Init state
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Preview Example:
Step 2 -- Create Datapath
Need tot register Need 8-bit comparator to compare s and tot Need 8-bit adder to perform tot = tot + a Wire the components as needed for above Create control input/outputs, give them names
Inputs: c (bit), a(8 bits), s (8 bits) Outputs: d (bit) Local registers: tot (8 bits) c Add Init d=0 tot=0 Wait c (tot<s) tot= tot+a c (tot<s) Disp d=1
tot_ld tot_clr 8
ld clr
tot 8 8
tot_lt_s
8-bit adder 8
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
tot_lt_s
Datapath
s 8
a 8
Controllers outputs
External output d (dispense soda) Outputs to datapath to load and clear the tot register
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
s a 8 8
tot_ld tot_clr 8
d=0 tot_clr=1
8-bit adder 8
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Controller
s1 0 0 0 0 0 0 0 0 1 1
s0 0 0 0 0 1 1 1 1 0 1
c 0 0 1 1 0 0 1 1 0 0
0 1 0 1 0 1 0 1 0 0
n1 0 0 0 0 1 0 1 1 0 0
n0 1 1 1 1 1 1 0 0 1 0
d 0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0 1 0
1 1 1 1 0 0 0 0 0 0
c d
Init Wait
c* tot _lt _s
tot_clr tot_lt_s
Add Disp
d=0 tot_clr=1
Controller
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Wait
That particular high-level state machine is sometime called as FSM with Data or FSMD Conventions same as FSM
Each transition is implicitly ANDed with raising clock edge Any bit output not explicitly assigned a value in a state is implicitly assigned a 0.
This convention does not apply for multibit outputs
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
The End
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Lecture-27
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
12-10-07
Objective : Modular approach for CPU design Register-Transfer Level (RTL) Design
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
sensor
Example of how to create a high-level state machine to describe desired processor behavior Laser-based distance measurement pulse laser, measure time T to sense reflection
Laser light travels at speed of light, 3*108 m/sec Distance is thus D = T sec * 3*108 m/sec / 2
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
sensor
to display
16
S from sensor
Inputs/outputs
B: bit input, from button to begin measurement L: bit output, activates laser S: bit input, senses laser reflection D: 16-bit output, displays computed distance
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
to laser
from sensor
Step 1: Create high-level state machine Begin by declaring inputs and outputs Create initial state, name it S0
Initialize laser to off (L=0) Initialize displayed distance to 0 (D=0)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
S0 L=0 D=0
S1
? B (button pressed)
Add another state, call S1, that waits for a button press
B stay in S1, keep waiting B go to a new state S2
S0 L=0 D=0
S1
Add a state S2 that turns on the laser (L=1) Then turn off laser (L=0) in a state S3 Q: What do next? A: Start timer, wait to sense reflection
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
S0 L=0 D=0
S1
S2 L=1
S3
Stay in S3 until sense reflection (S) To measure time, count cycles for which we are in S3
To count, declare local register Dctr Increment Dctr each cycle in S3 Initialize Dctr to 0 in S1. S2 would have been O.K. too
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Inputs: B, S (1 bit each) Outputs: L (bit), D (16 bits) Local Registers: Dctr (16 bits) B S0 L=0 D=0 S1 Dctr = 0 S2 L=1 S
to displ ay
16
from sensor
S3
S4
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
S S2 L=1 S3 S4
S1 Dctr = 0
I Q
T0 R = E + F A T1 R = R + G R (a) (b) R
add_A_s0 add_B_s0
21 A
21
(c)
(d)
Introduce mux when one component input can come from more than one source
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Laser-based distance measurer example Easy just connect all control signals between controller and datapath
Inputs: B, S (1 bit each) Outputs: L (bit), D (16 bits) Local Registers: Dctr (16 bits) B S
S0 L=0 D=0
S1 Dctr = 0
S2 L=1
S3
S4
Inputs: B, S FSM has same Outputs: L, Dreg_clr, Dreg_ld, Dctr_clr, Dctr_cnt structure as highB level state machine
Inputs/outputs all bits now Replace data operations by bit operations using datapath
S0
S3
S4 L=0 Dreg_clr = 0 Dreg_ld = 1 Dctr_clr = 0 Dctr_cnt = 0 (load D reg with Dctr/2) (stop counting)
L=0 Dreg_clr = 1 Dreg_ld = 0 Dctr_clr = 0 Dctr_cnt = 0 (laser off) A.Amalin Prince EEE/INSTR Group (clear D reg) CS GC391/EEE GC391/INSTR GC391
Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Inputs: B, S
S3
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Step 4
Controller from button B L Dreg_clr Dreg_ld Dctr_clr Dctr_cnt to display D 16
300 MHz Clock
Datapath
Datapath >>1 16 clear count Q Dctr: 16-bit up-counter 16 clear load I Q 16 D Dreg: 16-bit register
Inputs: B, S
S3
Implement FSM as state S4 register and Dreg_ld = 1 logic Dctr_cnt = 0 (load D reg with Dctr/2) (Studied) to (stop counting) complete the design
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Sets rd=1, A=address Appropriate peripheral places register data on 32-bit D lines
Periphs address provided on Faddr inputs (maybe from DIP switches, or another register)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
State SendData
Output Q1 onto D, wait for rd=0 (meaning main processor is done reading the D lines)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
W Z
SD Q1
W Z
SD
SD Q1
W Z
32 Datapath
Bus interface D
rd Q1_ld
A 4
rd
Faddr 4 ld
Q 32 Q1 32
32
Bus interface
Digitized
frame 1
Digitized
frame 2
Digitized
frame 1
Difference of
2 from 1
1 Mbyte
(a)
1 Mbyte
1 Mbyte
(b)
0.01 Mbyte
Video is a series of frames (e.g., 30 per second) Most frames similar to previous frame
Compression idea: just send difference from previous frame
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Differences (SAD)
Frame 2
Each is a pixel, assume represented as 1 byte (actually, a color picture might have 3 bytes per pixel, for intensity of red, green, and blue components of pixel)
Need to quickly determine whether two frames are similar enough to just send difference for second frame
Compare corresponding 16x16 blocks
Treat 16x16 block as 256-byte array
Compute the absolute value of the difference of each array item Sum those differences if above a threshold, send complete frame for second frame; if below, can use difference method (using another technique, not described)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
B go
2 < 5 i ! 6 ( )
sad
integer
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Inputs: A, B (256 byte memory); go (bit) Outputs: sad (32 bits) Local registers: sum, sad_reg (32 bits); i (9 bits) S0 go S1
2 < 5 i ! 6 ( )
S0: wait for go S1: initialize sum and index S2: check if done (i>=256) S3: add difference to sum, increment index S4: done, write to output sad_reg
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
(i<256)
A_data B_data
<256 9 i
8 32
sum 32 32
abs 8
) 6 5 2 t _ l i ( < !
S4
sad_reg=sum
AB_addr
A_data B_data
S0 go S1
?
9 i
8 32
sum 32 32 sad_reg
abs 8
sad_reg_ld
i ( ) 6 5 2 _ l t < !
) 6 5 2 t _ l i ( < !
32 sad
Step 3: Connect to controller Step 4: Replace high-level state machine by FSM A.Amalin Prince EEE/INSTR Group
CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
(i<256)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
The End
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Lecture-28
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
15-10-07
Objective : Modular approach for CPU design Register-Transfer Level (RTL) Design
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
R>=100 D
Why?
State A: R=99 and Q=R happen simultaneously State B: R not updated with R+1 until next clock cycle, simultaneously with state register being updated
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
R>=100 D
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
S P=A (a)
T P=P+B
T P=R+B
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
B R R
+ P (a)
Preg P
In fig (b), spurious outputs reduced, and longest register-to-register path is clear
(b)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Filter should remove such noise in its output Y Simple filter: Output average of last N values
Small N: less filtering Large N: more filtering, but less sharp output
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
RTL design
Step 1: Create high-level state machine
But there really is none! Data dominated indeed.
Go straight to step 2
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
180 181
180
12
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
c0
x(t-2) xt2
c2
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
* +
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
* +
*
yreg Y
No controller needed Extreme data-dominated example (Example of an extreme control-dominated design an FSM, with no datapath)
100-tap filter, following design on previous slide, would have about a 34-gate delay: 1 multiplier and 7 adders on longest path
Software
100-tap filter: 100 multiplications, 100 additions. Say 2 instructions per multiplication, 2 per addition. Say 10-gate delay per instruction. (100*2 + 100*2)*10 = 4000 gate delays
2 ns delay
+
c
Critical Path
Example shows four paths
a to c through +: 2 ns a to d through + and *: 7 ns b to d through + and *: 7 ns b to d through *: 5 ns
2 ns delay
2 ns
1 / 7 ns = 142 MHz
Max
(2,7,7,5) = 7 ns
7 ns 7 ns
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
5 ns
+
7 ns 7 ns
5 ns delay
Trend
1980s/1990s: Wire delays were tiny compared to logic delays But wire delays not shrinking as fast as logic delays
Wire delays may even be greater than logic delays!
+
3 ns
n s 3
2 ns 0.5 ns
3 ns
Must also consider register setup and hold times, also add to path Then add some time to the computed path, just to be safe
e.g., if path is 3 ns, say 4 ns instead
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
s 8
a 8
tot_ld c
tot_lt_s tot_clr (c) n1
ld
tot
clr 8
n0
tot_lt_s
8-bit adder
8
Timing analysis tools that evaluate all possible paths automatically very helpful
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
s1 clk
s0
(a)
The End
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Lecture-29
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
17-10-07
Objective : Modular approach for CPU design Register-Transfer Level (RTL) Design
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Pipelining
Intuitive example: Washing dishes with a friend, you wash, friend dries
You wash plate 1 Then friend dries plate 1, while you wash plate 2 Then friend dries plate 2, while you wash plate 3; and so on You dont sit and watch friend dry; you start on the next plate
Time
Without pipelining:
W1 D1 W2 D2 W3 D3
With pipelining:
W1 W2 W3 D1 D2 D3
Stage 1 Stage 2
Pipelining: Break task into stages, each stage outputs data for next stage, all stages operate concurrently (if they have data)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Pipelining Example
W X Y Z Stage 1 W X Y Z
+
s n 2 s n 2
+
2 n s 2 n s t s a g e 1
clk
2ns
clk
2 n s
+
clk
t s a g e 2
S S(0) S(1) S = W+X+Y+Z Datapath on left has critical path of 4 ns, so fastest clock period is 4 ns
Pipelining Example
W X Y Z W X Y Z
stage 1
2ns
2ns
2ns
+
Longest path is 2+2 = 4 ns
2ns
clk
clk
2ns
stage 2
2ns
+
clk S (b)
S(0)
S(1)
* +
* +
*
yreg Y
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
X xt registers
multipliers
+ +
yreg Y
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Concurrency
Concurrency: Divide task into Task subparts, execute subparts simultaneously
Dishwashing example: Divide stack into 3 substacks, give substacks to 3 neighbors, who work simultaneously -- 3 times speedup (ignoring time to move dishes to neighbors' homes) Concurrency does things side-byside; pipelining instead uses stages (like a factory line) Already used concurrency in FIR filter -- concurrent multiplications
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Concurrency
Can do both, too
Pipelining
* *
<256 9 i
8 32 abs 8
sum 32 32 sad_reg
sad_reg_ld
Datapath
32 sad
16 subtractors
S1
16 absolute values
) 6 1 t _ l i ! (
i_lt_16
+
Adder tree to sum 16 values
+
Controller Datapath sad
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Versus software
Recall: Estimated about 6 microprocessor cycles per iteration
256 iterations * 6 cycles per iteration = 1536 cycles Original design speedup vs. software: 1536 / 512 = 3x
) 6 1 t _ l i ! (
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Component Allocation
Another RTL tradeoff: Component allocation Choosing a particular set of functional units to implement a set of operations
e.g., given two states, each with multiplication
Can use 2 multipliers (*) OR, can instead use 1 multiplier, and 2 muxes Smaller size, but slightly longer delay due to the mux delay
A B A: (sl=0; sr=0; t1ld=1) B: (sl=1; sr=1; t4ld=1) t2 t5 t3 t6 sl 21 21 sr 2 mul 1 mul t1 t4 t1 (b) t4 delay (c)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
(a)
Operator Binding
Another RTL tradeoff: Operator binding Mapping a set of operations to a particular component allocation
Note: operator/operation mean behavior (multiplication, addition), while component (aka functional unit) means hardware (multiplier, adder) Different bindings may yield different size or delay
A t1 = t2* t3 B t4 = t5* t6 C t7 = t8* t3 A t1 = t2* t3 B t4 = t5* t6 C t7 = t8* t3
sl 2x1
sl 2x1
size
t2
t3
t5 t8
t6 t3
t2 t8
t3
t5
t6
s i
Binding 1 Binding 2
MULB t7 t1
MULA t7
MULB t4
delay
Binding 1
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Binding 2
Component allocation and Operator binding are sometimes refered to as Resource sharing
Operator Scheduling
Yet another RTL tradeoff: Operator scheduling Introducing or merging states, and assigning operations to those states.
A B C (some operations) A B B2 t4 = t5* t6 C (some operations) (some t1 = t2* t3 operations) t4 = t5* t6 t2 t5 t2 * t1 t3 t5 * t4
size
e z
t3 t6 2x1 sr *
but more delay due to muxes
t6 3-state schedule
sl 2x1
i s
smaller (only 1 *)
4-state schedule
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
t1
t4
delay
Tasks of scheduling, allocation, and binding are all interdependent Modern tools may combine the tasks somewhat, and/or may iterate among the tasks several times, in search of good designs.
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
* +
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
* +
*
yreg Y
S3
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
S5
Y = sum (b)
X clk x_ld
xt0
c0
xt1
c1
xt2
c2
mul_s1 3x 1 mul_s0
S3 sum = sum + xt1 * c1
yreg 3x 1
*
y_ld MAC
S4
+
sum
S5
Y = sum
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
high-level changes
size
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
delay (a)
land (b)
Algorithm Selection
Chosen algorithm can have big impact
e.g., which filtering algorithm?
FIR is one type, but others require less computation at expense of lower-quality filtering
Linear search
0x00000000 0x00000001 0x0000000F 0x000000FF 64
0: 1: 2: 3:
96: 128:
0x00000F0A 0x0000FFAA
96
128
Binary search
255:
Power Optimization
energy (1=value in 2001)
Until now, weve focused on size and delay Power is another important design criteria
Measured in Watts (energy/second)
Rate at which energy is consumed
2 1 2001 03 05
07
09
CMOS technology: Switching a wire from 0 to 1 consumes power (known as dynamic power)
P = k * CV2f
k: constant; C: capacitance of wires; V: voltage; f: switching frequency
xt0
high-power gates low-power gates on nonc ritical path low-power gates delay
e r
1/1
1/1
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
The End
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Lecture-30
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
19-10-07
Objective : MEMORY COMPONENTS
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Memory Components
Register-transfer level design instantiates datapath components to create datapath, controlled by a controller
A few more components are often used outside the controller and datapath
MxN memory
M words, N bits wide each
M words
N-bits wide each MN memory
Logically same as register file Memory with address inputs, data inputs/outputs, and control
RAM usually just one port; register file usually two or more
Register file
32 10
Let A = log2M
d0 addr0 addr1
r d a
addr(A-1)
clk
en rw
RAM cell
Let A = log2 M d0
wdata(N-1)
word enable
wdata(N-2) wdata0
bit storage block ,, (aka cell ) word ,,
rw en
1024x32 RAM
addr0 addr1
addr(A-1) clk en rw
rdata(N-1)
rdata(N-2)
rdata0
Internal circuit of memory is beyond the scope of this course. You will do in later courses courses
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
SRAM
Fast More compact than register file
DRAM
Slowest
And refreshing takes time
Use register file for small items, SRAM for large items, and DRAM for huge items
Note: DRAMs big capacitor requires a special chip design process, so DRAM is often a separate chip
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
500
1 means write
Writing
Put address on addr lines, data on data lines, set rw=1, en=1
Reading
Set addr and en lines, but put nothing (Z) on data lines, set rw=0 Data will appear on data lines
data
addr
rw
16 ad_buf ad_ld 12
en
Ra Rrw Ren
da_ld
digital-toanalog converter
wire
processor
Behavior
Well use a 4096x16 RAM (12-bit wide RAM not common)
speaker
Record: Digitize sound, store as series of 4096 12-bit digital values in RAM Play back later Common behavior in telephone answering machine, toys, voice recorders
To record, processor should read a-to-d, store read values into successive RAM words
To play, processor should read successive RAM words and enable d-to-a
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
processor
Record behavior
Local register: a (12 bits) a<4095 S a=0 T ad_ld=1 ad_buf=1 Ra=a Rrw=1 Ren=1
U a=a+1 a=4095
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
data bus
processor
Note: Must write d-to-a one cycle after reading RAM, when the read data is available on the data bus
Play behavior
Local register: a (12 bits) a<4095 V a=0 W ad_buf=0 Ra=a Rrw=0 Ren=1
The record and play state machines would be parts of a larger state machine controlled by signals that determine when to record or play
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
X da_ld=1 a=a+1
a=4095
32 10
Choose ROM over RAM if stored data wont change (or wont change often)
For example, a table of Celsius to Fahrenheit conversions in a digital thermometer
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Let A = log2M
d0 addr0 addr1
r d a
word enable
addr(A-1)
clk
e en
d(M-1)
ROM cell
Internal logical structure similar to RAM, without the data input lines
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
ROM Types
addr
addr0 addr1 addr(A-1) a0 a1 A M d1 decoder a(A-1) e d(M-1) word ,,
If a ROM can only be read, how are the stored bits stored in the first place?
Storing bits in a ROM known as programming Several methods
en
data
data(N-1)
data(N-2)
data0
Mask-programmed ROM
Bits are hardwired as 0s or 1s during chip manufacturing
2-bit word on right stores 10 word enable (from decoder) simply passes the hardwired value through transistor
word enable
ROM Types
addr
addr0 addr1
Each cell has a fuse A special device, known as a programmer, blows certain fuses (using higher-than-normal voltage)
Those cells will be read as 0s (involving some special electronics) Cells with unblown fuses will be read as 1s 2-bit word on right stores 10
addr(A-1)
word
en
data(N-1)
data(N-2)
data0
1 cell
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
,,
data
data line
ROM Types
Uses floating-gate transistor in each cell Special programmer device uses higherthan-normal voltage to cause electrons to tunnel into the gate
Electrons become trapped in the gate Only done for cells that should store 0 Other cells (without electrons trapped in gate) will be 1
2-bit word on right stores 10
addr
addr0 addr1 addr(A-1) a0 a1 A M d1 decoder a(A-1) e en d(M-1) word ,,
data
data(N-1)
data(N-2)
data0
floating-gate transistor
o r
word enable
n t i g a r t e t a g
trapped electrons
ROM Types
Electronically-Erasable Programmable ROM (EEPROM)
Similar to EPROM
Uses floating-gate transistor, electronic programming to trap electrons in certain cells
But erasing done electronically, not using UV light Erasing done one word at a time
Flash memory
Like EEPROM, but all words (or large blocks of words) can be erased simultaneously Become common relatively recently (late 1990s)
o r t n t i g a r t e
32 10
Can be programmed with new stored bits while in the system in which the ROM operates
Requires bi-directional data lines, and write control input Also need busy output to indicate that erasing is in progress erasing takes some time
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
speaker
Hello there!
Hello there!
16
digital-toanalog
Ra Ren
vibration sensor
converter da_ld v
processor
Processor should wait for vibration (v=1), then read words 0 to 4095 from the ROM, writing each to the d-to-a
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
a<4095
16
Ra Ren
U da_ld=1 a=a+1
processor
4096x16 Flash
analog-todigital converter
record microphone
4096x16 Flash
analog-todigital converter
microphone
Local register: a (13 bits) bu a<4096 T bu U er=0 ad_ld=1 ad_buf=1 Ra=a Rrw=1 Ren=1 a=a+1
V a=4096
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
ROM
Flash
RAM
EEPROM
NVRAM
New memory technologies evolving that merge RAM and ROM benefits
e.g., MRAM
Bottom line
Lot of choices available to designer, must find best fit with design goals
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Queues
A queue is another component sometimes used during RTL design Queue: A list written to at the back, from read from the front
Like a list of waiting restaurant customers
write items
to the back of the queue
back
front
read (and
remove) items from front of the queue
Writing called a push, reading called a pop Because first item written into a queue will be the first item read out, also called a FIFO (first-infirst-out)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Queues
7 6 5 4 3 2 1 0
Push (write)
Item written to address pointed to by rear rear incremented
A
rf 0 A
Pop (read)
Item read from address pointed to by front front incremented
7 B r 2 6 5 4 3 2
r 1 B
f 0 A f 0 A
If front or rear reaches 7, next (incremented) value should be 0 (for a queue with addresses 0 to 7)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
1 B
Queues
Treat memory as a circle
If front or rear reaches 7, next (incremented) value should be 0 rather than 8 (for a queue with addresses 0 to 7)
7 6 5 4 3 2 1 B r f 0 A
0 7
3 4
Queue Implementation
Can use register file for item storage Implement rear and front using up counters
rear used as register files write address, front as read address
wdata 16 3 8 16 register file wdata waddr wr wr rd clr inc rdata raddr rd 3 16 rdata
Simple controller would set control lines for pushes and pops, and also detect full and empty situations
FSM for controller not shown
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
reset
Controller
eq
=
full empty 8-word 16-bit queue
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Initially empty queue 7 1. After pushing 9, 5, 8, 5, 7, 2, 3 r 7 2. After popping r 7 3. After pushing 6 6 6 3 5 2 4 7 3 5 2 8 1 5 rf 0 9 f 0 9 data: 9
6 3
5 2
4 7
3 5
2 8
1 5 f 1 5 f 1 5 rf
6 3
5 2
4 7
3 5
2 8
0 9 r 0 3 full
7 4. After pushing 3 6
6 3
5 2
4 7
3 5
2 8
5. After pushing 4
The End
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Lecture-31
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
22-10-07
Objective : Programmable Logic Devices (PLDs)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
can augment with custom design of critical components higher performance, greater logic density custom IC fabrication -- suitable for high production volumes
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
ROM
2k words N-bit per work
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
32x8 ROM
5
0 1 2 3
32x8 ROM
28 29 30 31
D7
D6
D5
D4
D3
D2
D1
D0
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A4 A3 A2 A1 A0 Decoder 5-to-32
29 30 31
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
D7 D6 D5 D4 D3 D2 D1 D0
X 0 1 2 3 4 5 6 7
F(X)=X2 0 1 4 9 16 25 36 49
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
X2 X1 X0
3-to-8 Decoder
2 3 4 5 6 7
F5
F4
F3
F2
F1
F0
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
X2 X1 X0
3-to-8 Decoder
2 3 4 5 6 7
F5
F4
F3
F2
F1
F0 = X0
Not Used
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
X2 X1 X0
3-to-8 Decoder
2 3 4 5 6 7
F5
F4
F3
F2
F1
F0
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
INPUT
Programmable OR plane
OUTPUT
INPUT
Fixed OR plane
F/F OUTPUT
PAL: trademark of AMD, use PAL as an adjective or to receive a letter from AMDs lawyers AMD
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
F2
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
PLA minimization
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
PLA Example
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
m(0,1,2,4) B, C) = m(0,5,6,7)
F1 = AB + AC + BC F1 = AB + AC + BC F2 = AB + AC + ABC
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
F1 = AB + AC + BC F2 = AB + AC + A B C
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
F1
F2
PAL Device
A Programmable AND Plane A A B B IO1 IO2 IO1 IO1 IO1
IO2
B Fixed OR Plane
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Not programmed
IO2
Example
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Example (cont.)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Example (cont.)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Example (cont.)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
The End
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Lecture-32
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
24-10-07
Objective : Programmable Logic Devices (PLDs)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
SPLD
I1 I2 I3
O1
Fuse based "blown" fuse removes connection Memory based 1 creates connection
programmable node
Fuse based
O1
Memory based
PLD IC programmable nodes
mem 1 (b)
mem 0
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
I3I2'
O1
PLD IC
k p s
kps'
0 PLD IC
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
PLD Extensions
I1 I2 I3
O1
O2
PLD IC (a)
Two-output PLD
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
FF
Macrocell
2
O2
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
More on PLDs
Originally (1970s) known as Programmable Logic Array PLA
Had programmable AND and OR arrays
Memory based
As IC capacities increased, companies put multiple PLD structures on one chip, interconnecting them
Become known as Complex PLDs (CPLD), and older PLDs became known as Simple PLDs (SPLD)
General CPLD
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
CPLD structure
Logic block I/O block PLD PLD PLD PLD
Interconnects
PLD
PLD
PLD
PLD
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Programmable in seconds
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
0 0 0 1 1 0 1 1
x y
a1 a0
x=0 y=0
a1 a0
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
x1 x2 0 0 1 1 0 1 0 1
f1 1 0 0 1
(b) f 1 = x 1 x 2 + x 1 x 2
x1 1 0 0 1
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
f1
x2
(c) Storage cell contents in the LUT
(b)
k p s
Programming (seconds)
(c)
kps'
x+ t+ d
t d
8x1 Mem. 0 0 1 0 2 0 3 0 a2 0 a1 4 0 a0 5 6 1 7 0 D
8x1 Mem. 0 0 1 1 2 1 3 1 a2 1 a1 4 1 a0 5 6 1 7 1 D w
(c)
8x1 Mem.
(c)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Requires only 4 3-input LUTs (8x1 memories) much smaller than a 9-input LUT (512x1 memory)
1 2
D1 D0
D1 D0
(Note: decomposed one 4input AND input two smaller ANDs to enable partitioning into 3-input sub-circuits)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
uit
h as
2 in
put
s, 2
S ub
-cir c
i1
i0
(a)
(b)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
The End
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Lecture-33
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
26-10-07
Objective : Programmable Logic Devices (PLDs)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Programmable in seconds
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
0 0 0 1 1 0 1 1
x y
a1 a0
x=0 y=0
a1 a0
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
x1 x2 0 0 1 1 0 1 0 1
f1 1 0 0 1
(b) f 1 = x 1 x 2 + x 1 x 2
x1 1 0 0 1
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
f1
x2
(c) Storage cell contents in the LUT
(b)
k p s
Programming (seconds)
(c)
kps'
x+ 3 inputs t+ d 1 output
w=x+t+d t d
8x1 Mem. 0 0 1 0 2 0 3 0 a2 0 a1 4 0 a0 5 6 1 7 0 D
8x1 Mem. 0 0 1 1 2 1 3 1 a2 1 a1 4 1 a0 5 6 1 7 1 D w
(c)
8x1 Mem.
(c)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Requires only 4 3-input LUTs (8x1 memories) much smaller than a 9-input LUT (512x1 memory)
1 2
D1 D0
D1 D0
(Note: decomposed one 4input AND input two smaller ANDs to enable partitioning into 3-input sub-circuits)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
uit
h as
2 in
put
s, 2
S ub
-cir c
i1
i0
(a)
(b)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
P0 P1 P2 P3
P6 P7
o0 o1 m0 m1 m2 m3 Switch matrix
P4 P5
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
(a)
0 0 i1 i0
d3 d2
D1 D0
10 o0 m0 11 o1 m1 m2 m3 Switch matrix
m0 m1 m2 m3
D1 D0 d1 d0
i1 i0 (a)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
BeltWarn x w
0 k p s
00 o0 m0 10 o1 m1 m2 m3 Switch matrix
m0 m1 m2 m3
t 0 (a)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
P0 P1 P2 P3
00 o0 m0 00 o1 m1 m2 m3 Switch matrix
Can program CLB outputs to come from flip-flops or from LUTs directly
10
2x1 0
10
2x1
10
2x1 0
10
2x1 P6 P7 P8 P9
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
x (a)
0 0 a b
10 o0 m0 11 o1 m1 m2 m3 Switch matrix
w=a' x=b' 2 x1 1
10 10
2 x1
2 x1 1
10
10
2 x1 z y x w
(c)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
CLB
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Programming an FPGA
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
10 o0 m0 11 o1 m1 m2 m3 Switch matrix
2 x1 1
2x1
2 x1 1
2 x1 z y x w
(b) Pin
Conceptual view of configuration bit scan chain is that of a 40-bit shift register
This isn't wrong. Although the bits appear as "10" above, note that the scan chain passes through those bits from right to left so "01" is correct here.
FPGA Structure
Logic block
I/O block
Interconnects
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
IO blocks (IOB)
CLBs can be connected to passing wires. Wire segments connected by switch matrix. Long wire segments used to connect distant CLBs. Configuration information stored in SRAM bits that are loaded when power turns on.
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
FPGA Programmability
Floating gate transistor
Used in EPROM and EEPROM
Antifuse
Similar to fuse Originally an Open-Circuit One-Time Programmable (OTP)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
LUT4
D >
EC CLR PRE
Set/Reset Control
YQ
DIN H1 LUT3 1
F1 F2 F3 F4
LUT4
>
EC CLR
XQ
Flip Flop
1
S/R C
CLK
EC
S/R Sum
01101001 01101101
LUT4
ABCarry
S/R C D
0
PRE
DIN
01
>
EC CLR
Carry
H1
LUT3 1
1
D EN
00000000 00010111
PRE
LUT4
(AB+ACarry +BCarry)EN 1
>
EC CLR
XQ
Carry Function
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
S/R C
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
The End
Company headquarters in Hillsboro. Xilinx San Jose HQ Building at 2100 Logic Drive Altera headquarters in San Jose
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Lecture-34
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
29-10-07
Objective : Algorithmic State Machines (ASM Chart)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
(a) Symbol
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
For any valid combination of values to the decision - box variables, all simultaneously selected link path must lead to the same exit path.
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Looping
Rule-2
(a) Incorrect
(b) Correct
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
There is no closed loop that do not contain at least one state box.
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
The End
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Lecture-35
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
07-11-07
Objective : Algorithmic State Machines (ASM Chart)
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
State Assignment
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
The End
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
DECO
OBJECTIVE
Multiplication Division
12/11/2007
MULTIPLICATION
More complicated than addition Accomplished via shifting and addition Multiplication of two N- bit binary integers results in a product of up to 2N bits in length
12/11/2007
12/11/2007
12/11/2007
12/11/2007
12/11/2007
12/11/2007
12/11/2007
12/11/2007
10
12/11/2007
11
12/11/2007
12
12/11/2007
13
12/11/2007
14
DIVISION
Accomplished via shifting and addition / subtraction More complicated
12/11/2007
15
Two methods
Restoration method Non-Restoration method
12/11/2007
16
HARDWARE IMPLEMENTATION
12/11/2007
17
RESTORATION METHOD
Steps
1. 2. 3. 4.
Set A to zero Shift A and Q left one binary position Subtract M from A and place the answer back in A If MSB of A is 1, set Q0 to 0 and add M back to A (restore A); otherwise set Q0 to 1
5.
12/11/2007
18
Example:
12/11/2007
19
12/11/2007
20
NON-RESTORATION METHOD
Steps
1. 2.
Set A to zero If MSB of A is 0, Shift A and Q left one binary position and Subtract M from A ;otherwise, shift A and Q left and add M to A
3.
Now, if MSB of A is 0 , set Q0 to 1 ; otherwise set Q0 to 0 Repeat steps 2 & 3 for N times If MSB of A is 1, add M to A
4. 5.
12/11/2007
21
12/11/2007
22
Lecture-37
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
14-11-07
Objective : Asynchronous Sequential Logic
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Introduction
Fundamental mode
?
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Analysis Procedure
Determine all feedback loops in the circuit Designate the output of each feedback loop with variable Yi, and its corresponding input with yi for i=1,2,,km where k is the number of feedback loops in the circuit. Derive the Boolean functions of all Ys as a function of the external inputs and the ys. Plot each Y function in a map, using the y variable for the rows and the external inputs for the columns. Combine all the maps into one table showing the value of Y=Y1Y2Yk inside each square. Circle those values of Y in each square that are equal to the value of y=y1y2yk in the same row.
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Y1 = xy1 + x ' y2
Y2 = xy '1 + x ' y2
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Example1:Flow table
Primitive flow table It has only one stable state in each row.
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
The result is 0
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Y = S + R' y
Y = S1 + R'1 y1 = x1y2 + (x1 + x2 ) y1 = x1y2 + x1y1 + x2 y1 1 Y2 = S2 + R'2 y2 = x1x2 + (x2 + y '1) y2 = x1x2 + x2 y2 + y '1 y2
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Flow Table ?
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Implementation Procedure
Given a transition table that specifies the excitation function Y=Y1Y2,Yk, derive a pair of maps for Si and Ri for each i=1,2,,k. Derive the simplified Boolean functions for each Si and Ri. Care must be taken not to make Si and Ri equal to 1 in the same minterm square. Draw the logic diagram using k latches together with the gates required to generate the S and R Boolean functions. For NOR latches, use the S and R Boolean functions obtained in step 2. For NAND latches, use the complemented values of those obtained in step-2
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
The End
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Lecture-38
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
16-11-07
Objective : Asynchronous Sequential Logic
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Present State a b c d e f
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Implication Table
Present State a c d f Next State d d a c a f d a Output
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
The End
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Lecture-39
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
19-11-07
Objective : Asynchronous Sequential Logic
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Race Conditions
A race is said to exist in an asynchronous sequential circuit when two or more binary state variables change value in response to a change in an input variable. Race may cause the state variables to change in an unpredictable manner. If the final stable state that the circuit reaches does not depend on the order in which the state variables change, the race is called a noncritical race. If it is possible to end in two or more different stable states, depending on the order in which the state variable change, then it is a critical race. For proper operation, critical race must be avoided.
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Examples of Cycles
When a circuit goes through a unique sequence of unstable states, it is said to have a cycle
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Stability Considerations
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Exercise
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
The End
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Lecture-40
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
21-11-07
Objective : Asynchronous Sequential Logic
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Design Procedure
Obtain the primitive flow tale from the given design specifications. Reduce the flow table by merging rows in the primitive floe table. Assign binary state variables to each row of the reduced flow table to obtain the transition table. Assign output values to the dashes associated with the unstable states to obtain the output maps. Simplify the Boolean functions of the excitation and output variables and draw the logic diagram. The logic diagram can be drawn using S R latches.
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Design Example1
Design a gated latch circuit with two inputs, G (gate) and D (data), and one output, Q. Binary information present at the D input is transformed to the Q output when G is equal to 1. The Q output will follow the D input as long as G=1. When G goes to 0, the information that was present at the D input at the time the transition occurred is retained at the Q output. The gated latch is a memory element that accept the value of D when G=1 and retains this values after G goes to 0. Once G=0, a change in D does not change the value of the output Q.
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Design Example2
Design a fundamental-mode asynchronous sequential network meeting the following requirement.
There are two inputs x1 and x2 and a single output z. The inputs x1 and x2 never change simultaneously. The output is always to be 0 when x1=0, independent of the value of x2. The output is to become 1 if x2 changes while x1=1 and is to remain 1 until x1 becomes 0 again.
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Design Example3
Design a fundamental-mode asynchronous sequential network meeting the following requirements:
There are two inputs x1 and x2 and a single output z. The inputs x1 and x2 never change or are 1 simultaneously. An output of z=1 is to occur only during the input state x1x2=01 is preceded by the input sequence x1x2=01,00,10,00,10,00.
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
The End
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Lecture-41
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
23-11-07
Objective : Asynchronous Sequential Logic
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Hazards
Hazards are unwanted switching transients that may appear at the output of a circuit because different path exhibit different propagation delays. Hazards in Combinational circuit may cause a temporary false-output value. Hazards in asynchronous circuits may result in a transition to a wrong stable state. Hazards
Static Hazards
Static 0 Hazard Static 1 Hazard
Dynamic Hazards
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Hazard-Free Circuit
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Hazard-Free Circuit
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Consider inputs x1x2x3=000 and 100 Assume Delay of G1<G2<G4 and G3=G5=0
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Essential Hazards
An essential Hazard is caused by unequal delays along two or more paths that originate from the same input.
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
The End
A.Amalin Prince EEE/INSTR Group CS GC391/EEE GC391/INSTR GC391 Digital Electronics and Computer Organization BITS-Pilani Goa Campus
Von Neumann architecture Single bank of memory which processor accesses through a single set of address and data lines.
Processor core
Memory
Harvard Architecture The Processor is connected to two independent memory banks via two independent set of buses. Program bank and Data bank With modifications in Harvard Program bank will hold program instructions and data and other bank with data only.
A CISC PROCESSOR
Larger instructions with variable formats (16-64 bits/ instruction) Larger Addressing Modes (12- 24) Few Registers Most Microcoded with control Memory
Memory-to-memory
a=b
Block copy
memcpy(d,s,n);
Instruction count Usually more than 256 Maximum number of 8-bit opcodes Powerful instructions Many microcode steps Added some complexity to interrupt handling, page faulting, etc Variable length, multiple formats 1 to 10 bytes
Reduced Instruction Set Computer LOAD- STORE Architecture Fewer Addressing Modes Fixed Length Instructions More Registers Designed for Pipeline Efficiency Hardwired Control Unit
Two steps:
Fetch Execute
- Because
ADD AX, BX
(8086)
3-ADR M/C MUL T,A,B MUL X,C,D ADD X,X,T HLT 2 ADR M/C MOVE T,A MUL T,B MOVE X,C MUL X,D ADD X,T HLT
1 ADR M/C LOAD A MUL B STORE T LOAD C MUL D ADD T STORE X HLT
0 ADR M/C PUSH A PUSH B MUL PUSH C PUSH D MUL ADD POP X HLT
A CISC PROCESSOR
Larger instructions with variable formats (16-64 bits/ instruction) Larger Addressing Modes (12- 24) Few Registers Most Microcoded with control Memory
Designing a Processor
Given an instruction set how does one go about designing the processor, how to arrive at different architectural blocks like execution unit controller etc.,
Microprocessor (Computer s central Processing Unit) Ex: Pentium, 68000 etc. has two parts Control part says what to do Data part does it
CLU
Clock Generator
Bus Controller
Control Part
Processor Controller
Execution Unit
Data Part
EXECUTION UNIT
Programmers Register set Additional registers ( IR, PC , Temp Reg) ALU and any special function units Internal Data paths All connected through a interconnect network Usually comprised of one/more buses
Register Set:
Program Counter PC PC + 1, PC
CONTROL LINES F1 F2
CONTROL PART A Bus Controller to run the external bus cycles to fetch instructions (or) operands from memory and to write results back to memory
A clock generator to generate timing signals to decide the time durations of individual control steps
Macro/Micro Instructions
A TYPICAL INSTRUCTION - ADD R1, D2(B2) (R1, B2 - Registers ), D2- displacement (R1) + (Memory) (R1) ; (B2) + D2 Memory
5A
0
R1
B2
15 16
D2
31
CPU Operations
Fetch a word from Memory Store a word into memory Reg Transfers Performing an ALU function
Example Microinstructions:
Open/Close a gate from Reg to a bus Transfer data along a bus Send timing signals Test bits within a register
i. MAR
(R1)
ii. Read Signal iii. Wait for Memory-function-complete (MFC) signal iv. R2 (MDR)
(R1) (R2)
Register Transfers: R2 R1
To enable data transfer between various Blocks connected to common bus provide Input output gating.
Rin
Rout
Yin
ALU
Zin Z Zout
T2 T3
Wait IR MDR
- Instruction Fetch
T5 T6 T7
Y Z R1
R1 Y + M[MAR] Z
T2 T3
Wait IR MDR
T4
PC
PCout, Yin
T5
Y + [x of IR]
T6
PC
Step T1
Control Sequence PC+1 PCout, MARin, Clear Y, Set Carryin of ALU, ADD, Zin, READ Zout, PCin, Wait for MFC
T2 T3 T4 T5 T6 T7
MDRout, IRin Set Y, SPout, ADD, Zin Zout, ,MARin,,SPin MDRint, PCout, WRITE PCin, Addr-field of IRout, Wait for MFC, END
MDR PC PC IR
opcode field of IR. This field is decoded to provide the encoder information about instruction being decoded from status and condition
-Signals
-Control
.)
-External
- IMPLEMENTED
AS A COMBINATIONAL CIRCUIT.
Combinational design could be using PLDs. Hard wired logic difficult to implement changes Provides faster execution.
Microprogrammed Unit
-Sequence of microinstructions corresponding to each instruction is stored in ROM called Control Memory -Called Microprogram -Provides flexibility of implementation -Less hardware
Micro instruction word is the word whose bits represent control signals Ex: Y Z R1 R1 ; R1out, Yin, Wait for MFC
Step :R1in R1out Yin Zin Zout MDRout ADD WMFC END
Horizontal Approach -1 bit per control signal -Many control signals generated concurrently -Permitting very fast operation -Requires large control memory area
Vertical Approach - Most Micro instructions are mutually exclusive and never invoked simultaneously - Possible to divide into groups and use few bits to represent each group - A Decoder then used to select a particular Microoperation to be invoked
Micro instruction
.........
Decoder
Control Lines
-Control Memory size reduced -Additional hardware required -Slows down the process
Nanomemory -Third memory unit beside main memory and control memory -Appropriate when many microinstructions occur several time
Example:
Microprogram with k t-bit micro instructions To store this k x t size control memory required
Store these instructions in n-word, t-bit nanomemory Original program replaced by address of nanomemory word Reduction in memory size For ex: 16, 384 x 128 is the original size But has only 256 different microinstructions Nanomemory size is 256 x 128 Control ROM size is 16,384 x 8
(256 x 128)
Agenda
Memory Architecture Concepts
Caches Virtual Memory TLBs & Page Tables
MP Memory Organization
MP Classification Cache Coherence Memory Consistency
Spatial locality
If an item is referenced, nearby items will tend to be referenced soon
Cache Performance
Multiple level caches are the norm
Upper caches are smaller and faster than lower caches Inclusion principle is typically followed
Miss penalty
Miss rate
Block size
Block size
Cache Associativity
0 1 2 3 4 5 6 7 Block number 0 1 2 3 4 5 6 7 Block number 01234567
Set 0 Set 1 Set 2 Set 3
Index
Index used to select the set
Block Offset
Block offset is the address of the desired data within the block
Portions of an address
V <1>
Tag <20>
Data <64>
...
=?
...
Segmentation
Two Segment & offset May be visible to aplication programmer Hard must find contiguos, variable size unused portion of main memory External fragmentation unused portions of main memory Not always small segments may transfer only a few bytes
Virtual address needs to be translated to physical address for every main memory access
Process called address translation
Address Translation
PA 30 bits
Page Tables
Mapping for VA->PA organized in Page Tables
A collection of Page Table Entries (PTEs) Mapping of PA->VA organized in Inverted Page Tables
VA
<10>
<10>
PTP
PTP
PTE
Base Address
TLB coherence issues exist for MPs jus like cache coherence
Primary issue occurs when demapping a page Stale entries may exist in other TLBs need to be flushed
MP Memory Organization
SISD Processors
IS IS DS
Control Unit
Processing Unit
Memory Unit
SIMD Processors
Processing Unit IS IS DS Memory Unit DS
Control Unit
Processing Unit
DS
Memory Unit
DS
Processing Unit
DS
Memory Unit
DS
MISD Processors
Memory Unit IS IS IS DS
Control Unit IS
Control Unit IS DS
DS Processing Unit
DS Processing Unit
MIMD Processors
IS IS DS Control Unit Processing Unit IS IS DS
Control Unit
Processing Unit IS
Memory Unit
Control Unit
IS
Processing Unit
DS
Message Passing
Scalable beyond shared-memory Loosely coupled message passing for IPC
Symmetric
All processors are autonomous treated equal One copy of the kernel executed concurrently across all processors Synchronized access to shared data structures
Multithreaded kernel
SMP Classification
Parallel Processors
SIMD MIMD Shared Memory UMA NUMA MISD Message Passing COMA
SM1
SM2
SMn
IO
Single address space visible to all CPUs Memory access latency uniform for all processors Interconnect network could be a bus or a crossbar or switch Typically 8-16 nodes
P2
LM2
Pn
LMn
Interconnect Network (bus, xbar etc.) Single address space visible to all CPUs If collective cache size is big enough dispense with main memory Memory access latency is not uniform
Consistency
When will a written value be returned by a read
A memory system is coherent if a read of an item returns the most recently written value of that item. The system behaves as if there were no caches.
UMA MP Classification
Parallel Processors
SIMD MIMD Shared Memory UMA Snoopy Directory based NUMA MISD Message Passing COMA
Coherence Protocols
Directory Based
Sharing information about a cache block is kept in just one location the directory in main memory Requests sent only to relevant processors
Snooping Based
No centralized state information. Individual caches keep sharing information on their cache blocks. Bandwidth hungry doesnt scale well
Snooping Protocols
Write Invalidate
On a write, all cached copies of the cache block are invalidated except that of the writing processor. Writing Processor gains exclusive access to the cache block.
Description
Block is valid in this cache and only this cache. The block is modified w.r.t. the main memory it is dirty and has not been written back. This state may also be referred to as DirtyExclusive. Block is valid in this cache only. It is also consistent w.r.t the main memory it is not dirty. This state may also be referred to as Clean-Exclusive. Block is valid in this cache and at least one other cache. It is consistent w.r.t. the main memory. Shared blocks are never dirty. Block is invalid in this cache. It is not resident in this cache.
Invld data
Valid data
Valid data
Invld data
Dont care
Invld data
Dont care
Memory
Memory
Each cache block changes its state only if its address matches the event address
RH = Read Hit RMS = Read Miss, Shared RME = Read Miss, Exclusive WH = Write Hit WM = Write Miss SHR = Snoop Hit, Read Operation SHW = Snoop Hit, Write Operation
E
Update local cache value State E -> M
MOESI Protocol
MESI does not distinguish between SharedClean and Shared-Modified MOESI adds an Owned (O) state to signify Shared-Modified while the S state gets redefined as Shared-Clean Caches with O state update each others blocks but do not write back to main memory
Processes running on different processors A and B cached in both processors with initial value of 0 If memory always consistent impossible for both L1 and L2 to be TRUE What if write invalidates have some delay? Possible that both P1 and P2 have not seen invalidations for A & B How consistent a picture of memory must both processors see?
Processes running on different processors Flag is cached in both processors with initial value of 0 Expectation is that P2 will see data1 and data2 for A and B respectively after it gets through the wait loop on flag
Sequential Consistency
Interleaving of different processors in strict program order
Processor Consistency
Each Processors writes in program order but different processors writes may not be
Weak Consistency
Use of explict synchronization instructions to enforce sequential consistency
Release Consistency Weak consistency with two sync operators Release and Acquire
Sequential consistency
Result of any execution is the same as if
The accesses of each processor were kept in order and The accesses among different processors were arbitrarily interleaved
Implies that a processor delay any memory access till all invalidations required by previous writes are completed Presents a simple programming paradigm Reduces potential performance
Speculative execution w/ repair is a problem Write buffers are potential problems Reordered memory operations is another issue
Potentially higher performance but the burden of synchronization shifted to the programmer Used in IA-32 architecture
Orientation
Digital Electronics and Computer Organization (DECO)
CS GC391/EEE GC391/INSTR GC391
A.Amalin Prince
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
1
03-08-07
Objective : Orientation
AAP
Instructor-in-charge:
AAP
Team of Instructors:
Prof. Jagmohan Singh Dr.Iven Jose Mr.M.T.Abhilash Mr.D.B.Singh Mr.Abhihjeet Khadke Ms.Sushmita Wils.K Mr.Nitin Sharma Mrs.Chaya Devi
AAP CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Consultation Hours
Instructor A.Amalin Prince M.T.Abhilash Sushmita Wils.K Iven Jose Nitin Sharma Jagmohan Singh D.B.Singh Abhihjeet Khadke Chaya Devi
AAP
Day Thursday Tuesday Thursday Tuesday Monday Wednesday Saturday Saturday Tuesday
Time 11.00 to 12.00 11.00 to 12.00 04.00 to 05.00 10.00 to11.00 10.00 to 11.00 12.00 to 01.00 10.00 to 11.00 10.00 to 11.00 10.00 to 11.00
Course Description:
This course covers the topics on logic circuits and minimization, Combinational and sequential logic circuits, Programmable Logic devices, State table and state diagrams, Digital ICs, Arithmetic operations and algorithms, Introduction to Computer organization, Algorithmic State Machines and Verilog HDL.
AAP
Text Books
AAP
T1:
M.Moris Mano, Digital Design, PHI, 3rd Edition, 2002
AAP
T2:
G Raghurama, TSB Sudharshan , Introduction to Computer Organization, EDD notes 1997
AAP
AAP
R1:
Palnitkar.S , Verilog HDL Pearson Education Pvt. Ltd., 2004
AAP
R2:
Donald D. Givone , Digital Principles and Design TMH, 2003
AAP
R3:
Robert K.Dueck , Digital Design with CPLD Applications and VHDL , Thomson, 2002.
AAP
Course Plan:
Lect. No. 1 Learning Objectives Introduction to Digital Systems and Characteristics of Digital ICs. Boolean algebra and logic gates, Codes number systems Simplification of Boolean functions Simulation and synthesis basics Combinational Logic, Arithmetic circuits MSI Components Topics to be covered Digital Systems, Digital ICs Reference to Text Book 1.1; 1.9; 2.3, 10.1,2
2.
Boolean functions Canonical forms, number systems and codes K-Maps (4,5 variables), QM Method Hardware Description Language Adders, Subtracters Multipliers Comparators, Decoders, Encoders, MUXs, DEMUXs
1.2-7, 2.4-2.8;
3-5
6 7-9 10-11
AAP
Lect. No. 12
Learning Objectives
Topics to be covered
13-15
TTL, MOS Logic families and their characteristics RAM, ROM, PLA, PAL Flip-Flops & Characteristic tables, Latches. Analysis of clocked sequential circuits, state diagram and reduction Shift registers, Synchronous & Asynchronous counters
10.3, 10.5, 10.7 to 10.10 7.1, 7.5 to 7.7 5.1 to 5.3 5.4, 5.6
Memory and PLDs Sequential Logic Clocked Sequential Circuits Registers & Counters
23-24
6.1 to 6.5
AAP
Topics to be covered HDL for Sequential Logic, HDL for registers and counters Multiplication & Division algorithms
Reference to Text Book 5.5, 6.6 T2: Appendix A 8.1,8.2, 8.4 to 8.7 R2. Chapter 8 9.1 9.7 T2: Ch 6
Modular approach for CPU RTL, HDL description Design Design of Digital Systems Design of Asynchronous Circuits. Memory Organization Algorithmic State Machines Asynchronous Sequential Logic Memory Hierarchy & different types of memories
AAP
Evaluation Scheme:
Component Test I Test II Comprehensive Examination Practicals: Regularity, Lab reports & Assignment Lab test & Viva Duration 60 Min 60 Min 3 Hrs _____ Maximum Marks 50 50 120 40 Date 20-09-07 01-11-07 01-12-07 (AN) Regularly Remarks CB OB CB OB
To be announced
40
To be announced
CB
AAP
Name of the experiment Familiarization Of Bench Equipments Implementation Of Boolean Functions Using Logic Gates Adders And Subtractors Decoders, Multiplexers And Encoders Comparators & Arithmetic Logic Unit Implementation Of Combinational Logic In FPGA Latches & Flip-flops Operation Of 4 Bit Counter Implementation Of Sequential Logic In FPGA Shift Registers Sequential Circuits Implementation Of Mealy And Moore Machine In FPGA
CS GC391/EEE GC391/INSTR GC391 BITS-Pilani Goa Campus
Cycle I
II
III
IV
Assignment: To be announced in the class Notices: will be displayed on FTP & EEE/INSTR notice board Only Make-up Policy: -Prior Permission of the Instructor-in-Charge is required to take a make-up for a test/lab. - Make-up applications must be given to the Instructor-in-charge personally. - A make-up test/lab shall be granted only in genuine cases where - in the Instructors judgment the student would be physically unable to appear for the test.
AAP
AAP
The End
AAP