Principles Of Digital Design Combinatorial RTL Components Computation and Reorganization Arithmetic and Comparison Components Logic Components election Components ncoding/decoding Components Bit manipulation Copyright 2-23 by Daniel D. Gajski C 3/C3, University of California, Irvine
Digital RTL Components Digital components are divided into Combinatorial components asy to design, partition, and test n inputs Combinatorial Logic Circuit (Logic Gates) m outputs outputs = f (inputs) equential components n inputs Combinatorial Logic Circuit (Logic Gates) m outputs Memory outputs = f (inputs, time) Copyright 2-23 by Daniel D. Gajski 2 C 3/C3, University of California, Irvine
Combinatorial RTL Components Data Transformation Components Arithmetic Operation (Add, ubtract, Multiply, Divide) Data Comparison (Greater-than, qual, Less-than, ) Logic Operation (AND, OR, NOT, ) Bit Manipulation (hift, Rotate, xtract, ) Interconnection Components ource and Destination election Bus Connections and Interface Data Conversion Components Data ncoding (Unary to Binary) Data Decoding (Binary to Unary) Copyright 2-23 by Daniel D. Gajski 3 C 3/C3, University of California, Irvine
Design Principles ncapsulation Define simple building blocks Iteration Replicate building blocks as much as possible Hierarchy Compose larger building blocks from smaller ones Copyright 2-23 by Daniel D. Gajski 4 C 3/C3, University of California, Irvine
Ripple-Carry (erial) Adder c out X Adder c x i y i c i c i + s i x i y i x i y i c i 3 2 4 5 7 6 c i 3 2 4 5 7 6 s i = x i y i c i c i + = x i y i + c i (x i y i ) x i y i Map Representation Graphic ymbol c i + g i p i c out c 7 c 6 c 5 c 4 FA FA FA FA FA FA FA FA c 3 c 2 c c c i FA Logic chematic s i 8-bit Adder Unit chematic Copyright 2-23 by Daniel D. Gajski 5 C 3/C3, University of California, Irvine
Ripple-Carry (erial) Adder c out X Adder c x i y i c i c i + s i x i y i x i y i c i 3 2 4 5 7 6 c i 3 2 4 5 7 6 s i = x i y i c i c i + = x i y i + c i (x i y i ) x i y i Map Representation Graphic ymbol c i + g i p i c out c 7 c 6 c 5 c 4 FA FA FA FA FA FA FA FA c 3 c 2 c c c i FA Logic chematic s i 8-bit Adder Unit chematic Copyright 2-23 by Daniel D. Gajski 6 C 3/C3, University of California, Irvine
Two s Complement Adder/ubtractor Two s complement subtraction A B = A + B + ubtraction Procedure Complement B et input carry to Add to A c out A B Adder/ubtrator F Graphic ymbol a 7 b 7 a 6 b 6 a 5 b 5 a 4 b 4 a 3 b 3 a 2 b 2 a b a b Function Comment A + B Addition A + B + ubtraction c out FA FA FA FA FA FA FA FA f 7 f 6 f 5 f 4 f 3 f 2 f f 8-bit Adder/ubtractor Unit chematic Copyright 2-23 by Daniel D. Gajski 7 C 3/C3, University of California, Irvine
6-Function Logic Unit () Boolean functions of two variables have two inputs, one output, and four minterms. There are 6 Boolean functions of four variables (4 control lines) x i y i x i y i f f f 2 f 3 f 4 f 5 f 6 f 7 f 8 f 9 f f f 2 f 3 f 4 f 5 m m m 2 2 m 3 3 2 3 m 3 m 2 m m Boolean Function of 2 Variables s i = m + m + 2 m 2 + 3 m 3 = x i y i + x i y i + 2 x i y i + 3 x i y i LU -bit slice for 6-function LU s i Copyright 2-23 by Daniel D. Gajski 8 Logic chematic C 3/C3, University of California, Irvine
6-Function Logic Unit (2) Boolean functions of two variables have two inputs, one output, and four minterms. There are 6 Boolean functions of four variables (4 control lines) x 7 y 7 x 6 y 6 x 5 y 5 x 4 y 4 x 3 y 3 x 2 y 2 x y x y 2 3 X 2 3 Logic Unit LU LU LU LU LU LU LU LU F s 7 s 6 s 5 s 4 s 3 s 2 s s Graphic ymbol 8-bit Logic Unit chematic s i = m + m + 2 m 2 + 3 m 3 = x i y i + x i y i + 2 x i y i + 3 x i y i Copyright 2-23 by Daniel D. Gajski 9 C 3/C3, University of California, Irvine
2-bit Magnitude Comparator G = when X >, L = when X <, G = L = when X =. x x y y 3 2 4 5 7 6 x x y y 3 2 4 5 7 6 x x y y G L Copyright 2-23 by Daniel D. Gajski 2 3 5 4 8 9 G Map G = x y + x y y + x x y L = x y + x x y + x y y Boolean quations G L Logic chematic 2 3 5 4 8 9 x y x y C 3/C3, University of California, Irvine L Map
8-bit Magnitude Comparator Larger magnitude comparators can be constructed from basic 2-bit comparators using the following equations G i = (x i > y i ) OR ((x i = y i ) AND (G i > L i )) L i = (x i < y i ) OR ((x i = y i ) AND (G i < L i )) x 7 y 7 x 6 y 6 x 5 y 5 x 4 y 4 x 3 y 3 x 2 y 2 x y x y x 7 y 7 x 6 y 6 x 5 y 5 x 4 y 4 x 3 y 3 x 2 y 2 x y x y G L G L G L G L G 7 L 7 G L G 6 L 6 L L 5 L L 4 L L 3 L L 2 L L G G 5 G G 4 G G 3 G G 2 G G G L G L G L erial Implementation (n comparator delays) G L G 7 L 7 Parallel Implementation (log(n) comparator delays) Copyright 2-23 by Daniel D. Gajski C 3/C3, University of California, Irvine
2-to- elector electors (Multiplexers) are used for selecting one of many sources of data D D D D Graphic ymbol elector D D Boolean xpression = D + D Logic chematic Copyright 2-23 by Daniel D. Gajski 2 C 3/C3, University of California, Irvine
4-to- elector D 3 D 2 D D Graphic ymbol D 3 D 2 D D 3 2 elector D D D 2 D 3 = D + D + D 2 + D 3 Boolean xpression Logic chematic Copyright 2-23 by Daniel D. Gajski 3 C 3/C3, University of California, Irvine
8-to- elector 2 D D D 2 D 3 D 4 Implementation with 2-to- electors D 5 D 6 D 7 Implementation with 3-to-8 Decoder D 7 D 6 D 5 D 4 D 3 D 2 D D D 7 D 6 D 5 D 4 D 3 D 2 D D 2 Decoder 7 6 5 4 3 2 2 Copyright 2-23 by Daniel D. Gajski 4 C 3/C3, University of California, Irvine
8-to- elector 2 D D D 2 D 3 D 4 Implementation with 2-to- electors D 5 D 6 D 7 Implementation with 3-to-8 Decoder D 7 D 6 D 5 D 4 D 3 D 2 D D D 7 D 6 D 5 D 4 D 3 D 2 D D Decoder 7 6 5 4 3 2 Copyright 2-23 by Daniel D. Gajski 5 C 3/C3, University of California, Irvine
Bus Implementation Bus drivers have three possible output values:,, and Z (High Impedance Disconnection) D Z D Decoder 3 2 D D D 2 Tristate Driver ymbol D D 3 D D D D 2 D D 3 D 2-input Bus 4-input Bus Copyright 2-23 by Daniel D. Gajski 6 C 3/C3, University of California, Irvine
8-bit hifter -bit left or right shift or rotation Function Table 2 Comment X D No hift X Not Used shl(d) hift Left rtl(d) Rotate Left shr(d) hift Right rtr(d) Rotate Right hifter Implemented with 4-to- electors d 7 d 6 d 5 d 4 d 3 d 2 d d Right Input Left Input elector elector 3 2 elector 3 2 3 2 3 2 3 2 elector elector elector elector elector elector elector 3 2 3 2 3 2 2 y 7 y 6 y 5 y 4 y 3 y 2 y y Copyright 2-23 by Daniel D. Gajski 7 C 3/C3, University of California, Irvine
8-bit hifter (xample) -bit left or right shift or rotation Function Table 2 Comment X D No hift X Not Used shl(d) hift Left rtl(d) Rotate Left shr(d) hift Right rtr(d) Rotate Right hifter Implemented with 4-to- electors d 7 d 6 d 5 d 4 d 3 d 2 d d X X elector elector 3 2 elector 3 2 3 2 3 2 3 2 3 2 3 2 3 2 elector elector elector elector elector elector elector y 7 y 6 y 5 y 4 y 3 y 2 y y Copyright 2-23 by Daniel D. Gajski 8 C 3/C3, University of California, Irvine
8-bit Right Rotator Right rotation from to 7 bit position d 7 d 6 d 5 d 4 d 3 d 2 d d 2 y 7 y 6 y 5 y 4 y 3 y 2 y y d 7 d 6 d 5 d 4 d 3 d 2 d d d d 7 d 6 d 5 d 4 d 3 d 2 d d d d 7 d 6 d 5 d 4 d 3 d 2 d 2 d d d 7 d 6 d 5 d 4 d 3 d 3 d 2 d d d 7 d 6 d 5 d 4 d 4 d 3 d 2 d d d 7 d 6 d 5 d 5 d 4 d 3 d 2 d d d 7 d 6 d 6 d 5 d 4 d 3 d 2 d d d 7 2 y 7 y 6 y 5 y 4 y 3 y 2 y y Rotator Implemented with 2-to- electors Copyright 2-23 by Daniel D. Gajski 9 C 3/C3, University of California, Irvine
8-bit Right Rotator (xample) Right rotation from to 7 bit position d 7 d 6 d 5 d 4 d 3 d 2 d d 2 y 7 y 6 y 5 y 4 y 3 y 2 y y d 7 d 6 d 5 d 4 d 3 d 2 d d d d 7 d 6 d 5 d 4 d 3 d 2 d d d d 7 d 6 d 5 d 4 d 3 d 2 d 2 d d d 7 d 6 d 5 d 4 d 3 d 3 d 2 d d d 7 d 6 d 5 d 4 d 4 d 3 d 2 d d d 7 d 6 d 5 d 5 d 4 d 3 d 2 d d d 7 d 6 d 6 d 5 d 4 d 3 d 2 d d d 7 y 7 y 6 y 5 y 4 y 3 y 2 y y Rotator Implemented with 2-to- electors Copyright 2-23 by Daniel D. Gajski 2 C 3/C3, University of California, Irvine
-to-2 Decoder Decoders are used for enabling one or more components A A A C C Decoder C C Graphic ymbol X C = A C = A Copyright 2-23 by Daniel D. Gajski Boolean xpression 2 C C Logic chematic C 3/C3, University of California, Irvine
2-to-4 Decoder A A C 3 C 2 C C A A Graphic ymbol Decoder 3 2 X X C 3 C 2 C C A A Boolean xpression C = A A C = A A C 2 = A A C 2 = A A Logic chematic C 3 C 2 C C Copyright 2-23 by Daniel D. Gajski 22 C 3/C3, University of California, Irvine
2-to-4 Decoder (xample) A A C 3 C 2 C C A A Graphic ymbol Decoder 3 2 X X C 3 C 2 C C Boolean xpression C = A A C = A A C 2 = A A C 2 = A A Logic chematic Copyright 2-23 by Daniel D. Gajski 23 C 3/C3, University of California, Irvine
3-to-8 Decoder A 2 A A C 7 C 6 C 5 C 4 C 3 C 2 C C Larger decoders can be built as a tree of smaller decoders Graphic ymbol A 2 A A Decoder C 7 C X X X A 2 A A A 2 A A 3 2 3 2 C 7 C 6 C 5 C 4 Implementation with 2-to-4 Decoders Copyright 2-23 by Daniel D. Gajski C 3 C 2 C C 24 C 7 C 6 C 5 C 4 C 3 C 2 C C Implementation with -to-2 Decoders C 3/C3, University of California, Irvine
3-to-8 Decoder A 2 A A C 7 C 6 C 5 C 4 C 3 C 2 C C Larger decoders can be built as a tree of smaller decoders Graphic ymbol A 2 A A Decoder C 7 C X X X 3 2 3 2 C 7 C 6 C 5 C 4 C 3 C 2 C C Implementation with 2-to-4 Decoders Copyright 2-23 by Daniel D. Gajski 25 C 7 C 6 C 5 C 4 C 3 C 2 C C Implementation with -to-2 Decoders C 3/C3, University of California, Irvine
2-to- Priority ncoder ncoder is opposite of decoder, but with priority for MB D D D D ncoder Any A Graphic ymbol D D A Any X A = D Any = D + D Any A Boolean xpression Logic chematic Copyright 2-23 by Daniel D. Gajski 26 C 3/C3, University of California, Irvine
4-to-2 Priority ncoder D 3 D 2 D D 3 2 ncoder D 2 D D 3 D Any A A Graphic ymbol D 3 D 2 D D A A Any X X X X X X A = D 2 D + D 3 A = D 2 + D 3 Any = D + D + D 2 + D 3 Boolean xpression Any A Logic chematic A Copyright 2-23 by Daniel D. Gajski 27 C 3/C3, University of California, Irvine
8-to-3 Priority ncoder Larger encoders can be built from smaller encoders and selectors Implementation with 2-to- ncoders and electors D 7 D 6 D 5 D 4 D 3 D 2 D D A 2 A A Any X X X X X X X X X X X X X X X X X X X X X X X X X X X X Implementation with 4-to-2 ncoder D 7 D 6 D 5 D 4 D 3 D 2 D D D 7 D 6 D 5 D 4 D 3 D 2 D D ncoder ncoder ncoder ncoder 3 2 3 2 ncoder ncoder ncoder elector ncoder elector ncoder elector elector ncoder elector elector Any A 2 Copyright 2-23 by Daniel D. Gajski A A 28 Any A 2 A A C 3/C3, University of California, Irvine
8-to-3 Priority ncoder Larger encoders can be built from smaller encoders and selectors Implementation with 2-to- ncoders and electors D 7 D 6 D 5 D 4 D 3 D 2 D D A 2 A A Any X X X X X X X X X X X X X X X X X X X X X X X X X X X X Implementation with 4-to-2 ncoder ncoder ncoder ncoder ncoder 3 2 3 2 ncoder ncoder ncoder elector ncoder elector ncoder elector elector ncoder elector elector Copyright 2-23 by Daniel D. Gajski 29 C 3/C3, University of California, Irvine
Combinatorial RTL ummary Described basic combinatorial RTL components: Adders ubtractors Logic Units Decoders electors Buses ncoders Comparators hifters Presented design for combinatorial components Discussed procedures for building larger components from smaller ones Copyright 2-23 by Daniel D. Gajski 3 C 3/C3, University of California, Irvine