CSE 140 Lecture 12 Standard Combinational Modules Professor
CSE 140 Lecture 12 Standard Combinational Modules Professor CK Cheng CSE Dept. UC San Diego 1
Part III - Standard Combinational Modules (Chapter 5) Signal Transport • Decoder: Decode address • Encoder: Encode address • Multiplexer (Mux): Select data by address • Demultiplexier (De. Mux): Direct data by address • Shifter: Shift bit location Data Operator • Adder: Add two binary numbers • Multiplier: Multiply two binary numbers 2
Interconnect: Decoder, Encoder, Mux, De. Mux Processors Arbiter Data 1 Mux Memory Bank P 1 Address 1 P 2 Address 2 Data Demux n-m Mux Address n Address k Data k m 2 m Decoder Pk 3
1. Decoder • • Definition Logic Diagram Application (Universal Set) Tree of Decoders 4
i. Clicker: Decoder Definition A. A device that decodes B. An electronic device that converts signals from one form to another C. A machine that converts a coded text into ordinary language D. A device or program that translates encoded data into its original format E. All of the above 5
Decoder Definition: A digital module that converts a binary address to the assertion of the addressed device EN (enable) I 0 0 I 1 1 I 2 2 n inputs n= 3 0 1 2 3 4 5 6 7 y 0 y 1 . . y 7 2 n outputs 23= 8 n to 2 n decoder function: yi = 1 if En= 1 & (I 2, I 1, I 0 ) = i yi= 0 otherwise 6
1. Decoder: Definition • N inputs, 2 N outputs • One-hot outputs: only one output HIGH at once EN EN= 1 7
Decoder: Logic Diagram En I 0 ’ I 1 ’ I 2 ’ y 0 I 0 ’ I 1 ’ I 2 y 1 yi = mi En y 0= 1 if (I 2, I 1, I 0 )=(0, 0, 0) & En= 1 . . I 0 I 1 I 2 y 7= 1 if (I 2, I 1, I 0 )=(1, 1, 1) & En= 1 8
Decoder Application: universal set {Decoder, OR} Example: Implement functions f 1(a, b, c) = Sm(1, 2, 4) f 2(a, b, c) = Sm(2, 3), and f 3(a, b, c) = Sm(0, 5, 6) with a 3 -input decoder and OR gates. En c I 0 b I 1 a I 2 0 1 2 3 4 5 6 7 y 0 y 1. . y 7 y 1 y 2 y 4 f 1 y 2 y 3 f 2 y 0 y 5 y 6 f 3 9
Decoders • OR minterms En 10
Tree of Decoders Implement a 4 -24 decoder with 3 -23 decoders. d c b I 0 I 1 I 2 0 1 2 3 4 5 6 7 y 0 y 1 0 1 2 3 4 5 6 7 y 8 y 9 y 7 y 15 a 11
Tree of Decoders Implement a 6 -26 decoder with 3 -23 decoders. En En I 2, I 1, I 0 I 5, I 4, I 3 I 2, I 1, I 0 D 0 y 7 y 8 D 1 … y 15 … y 56 I 2, I 1, I 0 D 7 y 63 12
2. Encoder • Definition • Logic Diagram • Priority Encoder 13
i. Clicker: Definition of Encoder A. Any program, circuit or algorithm which encodes B. In digital audio technology, an encoder is a program that converts an audio WAV file into an MP 3 file C. A device that convert a message from plain text into code D. A circuit that is used to convert between digital video and analog video E. All of the above 14
Encoder Definition: A digital module that converts the assertion of a device to the binary address of the device. En I 2 n-1…I 0 yn-1 …y 0 A En I 0 I 7 8 inputs 0 1 2 3 4 5 6 7 0 1 2 A y 0 y 1 y 2 Encoder Description: At most one Ii = 1. (yn-1, . . , y 0 ) = i if Ii = 1 & En = 1 (yn-1, . . , y 0 ) = 0 otherwise. A = 1 if En = 1 and one i s. t. Ii = 1 A = 0 otherwise. 3 outputs 15
Encoder: Logic Diagram En y 0 I 1 I 3 I 5 I 7 En y 1 I 2 I 3 I 6 I 7 16
Encoder: Logic Diagram En y 2 I 4 I 5 I 6 I 7 En I 0 I 1. . A I 6 I 7 17
Priority Encoder: Definition Description: Input (I 2 n-1, …, I 0), Output (yn-1 , …, , y 0) = i if Ii = 1 & En = 1 & Ik = 0 for all k > i (high bit priority) or for all k< i (low bit priority). I 0 0 1 2 3 4 5 6 7 0 1 2 I 7 y 0 y 1 y 2 Eo = 1 if En = 1 & Ii = 0 for all i, Gs = 1 if En = 1 & i s. t. Ii = 1. E En (Gs is like A, and Eo tells us if enable is true or not). Eo Gs 18
Priority Encoder: Implement a 32 -input priority encoder w/ 8 input priority encoders (high bit priority). En I 31 -24 y 32, y 31, y 30 Eo Gs I 25 -16 y 22, y 21, y 20 Eo Gs I 15 -8 y 12, y 11, y 10 Eo Gs I 7 -0 y 02, y 01, y 00 Eo Gs 19
- Slides: 19