Presentation is loading. Please wait.

Presentation is loading. Please wait.

Henry Hexmoor1 C hapter 4 Henry Hexmoor-- SIUC Rudimentary Logic functions: Value fixing Transferring Inverting.

Similar presentations


Presentation on theme: "Henry Hexmoor1 C hapter 4 Henry Hexmoor-- SIUC Rudimentary Logic functions: Value fixing Transferring Inverting."— Presentation transcript:

1 Henry Hexmoor1 C hapter 4 Henry Hexmoor-- SIUC Rudimentary Logic functions: Value fixing Transferring Inverting

2 Henry Hexmoor2 Functions and Functional Blocks The functions considered are those found to be very useful in design Corresponding to each of the functions is a combinational circuit implementation called a functional block. In the past, many functional blocks were implemented as SSI, MSI, and LSI circuits. Today, they are often simply parts within a VLSI circuits.

3 Henry Hexmoor3 Rudimentary Logic Functions Functions of a single variable X Can be used on the inputs to functional blocks to implement other than the block’s intended function Value fixing inverting transfer 0 1 F= 0 F= 1 (a) F= 0 F= 1 V CC or V DD (b) XF= X (c) XF= X (d)

4 Henry Hexmoor4 Multiple-bit Rudimentary Functions Multi-bit Examples: A wide line is used to represent a bus which is a vector signal In (b) of the example, F = (F 3, F 2, F 1, F 0 ) is a bus. The bus can be split into individual bits as shown in (b) Sets of bits can be split from the bus as shown in (c) for bits 2 and 1 of F. The sets of bits need not be continuous as shown in (d) for bits 3, 1, and 0 of F. See Example 4-1 F (d) 0 F 3 1 F 2 F 1 A F 0 (a) 0 1 A F 0 (b) 4 2:1 F(2:1) 2 F (c) 4 3,1:0 F(3), F(1:0) 3 A A

5 Henry Hexmoor5 Enabling Function Enabling permits an input signal to pass through to an output Disabling blocks an input signal from passing through to an output, replacing it with a fixed value See Example 4-2 Automobile…

6 Henry Hexmoor6 Decoding - the conversion of an n-bit input code to an m-bit output code with n  m  2 n such that each valid code word produces a unique output code Circuits that perform decoding are called decoders Here, functional blocks for decoding are – called n-to-m line decoders, where m  2 n, and –generate 2 n (or fewer) minterms for the n input variables Decoding 4-3

7 Henry Hexmoor7 Binary n-to-2 n Decoders A binary decoder has n inputs and 2 n outputs. Only the output corresponding to the input value is equal to 1. : : n inputs n to 2 n decoder 2 n outputs

8 Henry Hexmoor8 1-to-2-Line Decoder Decoder Examples AD 0 D (a)(b) D 1 = A A D 0 = A

9 Henry Hexmoor9  Note that the 2-4-line made up of 2 1-to-2- line decoders and 4 AND gates. Decoder Examples A A D D D D (a) D 0 = A 1 A 0 D 1 = A 1 A 0 D 2 = A 1 A 0 D 3 = A 1 A 0 (b) A 1 A 0

10 Henry Hexmoor10 Decoder Expansion - Example 3-to-8-line decoder –Number of output ANDs = 8 –Number of inputs to decoders driving output ANDs = 3 –Closest possible split to equal 2-to-4-line decoder 1-to-2-line decoder –2-to-4-line decoder Number of output ANDs = 4 Number of inputs to decoders driving output ANDs = 2 Closest possible split to equal –Two 1-to-2-line decoder

11 Henry Hexmoor11 Decoder Expansion – 3-to-8 line Example Result

12 Henry Hexmoor12 CS 315: Decoding 4-3 OR Gate A n-to-m line: An n bit binary code is converted to a unique m bit binary pattern See Figure 4-6 for 1-to-2 line decoder 1.Let k = n. 2.If k is even, divide k by 2 to obtain k/2. Use 2 k AND gates driven by two decoders of output size 2 k/2. 3.If k is odd, obtain (k+1)/2 and (k-1)/2, Use 2 K AND gates driven by a decoder of output size 2 (k-1)/2. 4.For each decoder resulting from step 2, repeat step 2 with k equal to the values obtained in step 2 until K = 1. For k = 1, use a 1-to-2 decoder.

13 Henry Hexmoor13 Decoder Expansion General procedure given in book for any decoder with n inputs and 2 n outputs. This procedure builds a decoder backward from the outputs. The output AND gates are driven by two decoders with their numbers of inputs either equal or differing by 1. These decoders are then designed using the same procedure until 1-to-2-line decoders are reached. The procedure can be modified to apply to decoders with the number of outputs ≠ 2 n

14 Henry Hexmoor14 Decoder Example: Seven-Segment Decoders A seven segment decoder has 4-bit BCD input and the seven segment display code as its output: In minimizing the circuits for the segment outputs all non-decimal input combinations (1010, 1011, 1100,1101, 1110, 1111) are taken as don’t-cares /Bl D C B A a b c d e f g 0 x x x x don’t care inputs --

15 Henry Hexmoor15 Decoder Expansion - Example 7-to-128-line decoder –Number of output ANDs = 128 –Number of inputs to decoders driving output ANDs = 7 –Closest possible split to equal 4-to-16-line decoder 3-to-8-line decoder –4-to-16-line decoder Number of output ANDs = 16 Number of inputs to decoders driving output ANDs = 2 Closest possible split to equal –2 2-to-4-line decoders –Complete using known 3-8 and 2-to-4 line decoders

16 Henry Hexmoor16 In general, attach m-enabling circuits to the outputs See truth table below for function –Note use of X’s to denote both 0 and 1 –Combination containing two X’s represent four binary combinations Alternatively, can be viewed as distributing value of signal EN to 1 of 4 outputs In this case, called a demultiplexer Decoder with Enable

17 Henry Hexmoor17 Encoding 4-4 Encoding - the opposite of decoding - the conversion of an m-bit input code to a n-bit output code with n  m  2 n such that each valid code word produces a unique output code Circuits that perform encoding are called encoders An encoder has 2 n (or fewer) input lines and n output lines which generate the binary code corresponding to the input values Typically, an encoder converts a code containing exactly one bit that is 1 to a binary code corres- ponding to the position in which the 1 appears.

18 Henry Hexmoor18 Encoder > nm I0 I1 I2 … I2 n-1 Y0 Y1 … Y n-1 2 n inputs n outputs 2 n – n encoder requires “n 2 n-1 input” OR gates Bit j of input code is connected to OR gate j if bit j in the input is 1. Encoders are useful when the occurrence of one of several disjoint events needs to be represented by an integer identifying the event. E.g., wind direction encoder OR 0 OR 1 OR 2 I1,I3, I5, I7 I2, I3, I6, I7 I4, I5, I6, I7 Y0 = y1 y2 0 th bit

19 Henry Hexmoor19 Encoder Example 1

20 Henry Hexmoor20 Encoder Example 2 A decimal-to-BCD encoder –Inputs: 10 bits corresponding to decimal digits 0 through 9, (D 0, …, D 9 ) –Outputs: 4 bits with BCD codes –Function: If input bit D i is a 1, then the output (A 3, A 2, A 1, A 0 ) is the BCD code for i, The truth table could be formed, but alternatively, the equations for each of the four outputs can be obtained directly.

21 Henry Hexmoor21 Encoder Example (continued) Input D i is a term in equation A j if bit A j is 1 in the binary value for i. Equations: A 3 = D 8 (1000) + D 9 (1001) A 2 = D 4 (0100)+ D 5 (0101) + D 6 (0110)+ D 7 (0111) A 1 = D 2 (0010)+ D 3 (0011) + D 6 (0110) + D 7 (0111) A 0 = D 1 (0001)+ D 3 (0011)+ D 5 (0101) + D 7 (0111) + D 9 (1001) F 1 = D 6 + D 7 can be extracted from A 2 and A 1.

22 Henry Hexmoor22 Priority Encoder If more than one input value is 1, then the encoder just designed does not work. One encoder that can accept all possible combinations of input values and produce a meaningful result is a priority encoder. Among the 1s that appear, it selects the most significant input position (or the least significant input position) containing a 1 and responds with the corresponding binary code for that position. Priority encoders are useful when inputs have a predefined priority, e.g., interrupt requests from peripheral devices

23 Henry Hexmoor23 Priority Encoder Example Priority encoder with 5 inputs (D 4, D 3, D 2, D 1, D 0 ) - highest priority to most significant 1 present - Code outputs A2, A1, A0 and V where V indicates at least one 1 present. Xs in input part of table represent 0 or 1; thus table entries correspond to product terms instead of minterms. The column on the left shows that all 32 minterms are present in the product terms in the table No. of Min- terms/Row Inputs Outputs D4D3D2D1D0A2A1A0V XXX X XX XXX XXXX1001 A 1 = D 3 ’D 2 + D 3 A 0 = D 3 ’D 2 ’D 1 + D 3 V = D 0 + D 1 + D 2 + D 3

24 Henry Hexmoor24 Selecting of data or information is a critical function in digital systems and computers Circuits that perform selecting have: –A set of information inputs from which the selection is made –A single output –A set of control lines for making the selection Logic circuits that perform selecting are called multiplexers Selecting can also be done by three-state logic or transmission gates Selecting 4-5

25 Henry Hexmoor25 Multiplexers A multiplexer selects information from an input line and directs the information to an output line A typical multiplexer has n control inputs (S n  1, … S 0 ) called selection inputs, 2 n information inputs (I 2 n  1, … I 0 ), and one output Y A multiplexer can be designed to have m information inputs with m  2 n as well as n selection inputs

26 Henry Hexmoor26 Selecting 4-5 OR Gate A Multiplexers, data selectors 2 n input lines + n selection inputs See 2-to-1-line multiplexer in Figure 4-13 Two input lines and one select line S Y = S’I 0 + S I 1

27 Henry Hexmoor27 2-to-1-Line Multiplexer The single selection variable S has two values: –S = 0 selects input I 0 –S = 1 selects input I 1 The equation: Y = S’I 0 + SI 1 The circuit:

28 Henry Hexmoor28 2-to-1-Line Multiplexer (continued) Note the regions of the multiplexer circuit shown: –1-to-2-line Decoder –2 Enabling circuits –2-input OR gate To obtain a basis for multiplexer expansion, we combine the Enabling circuits and OR gate into a 2  2 AND-OR circuit: –1-to-2-line decoder –2  2 AND-OR In general, for an 2 n -to-1-line multiplexer: –n-to-2 n -line decoder –2 n  2 AND-OR

29 Henry Hexmoor29 Example: 4-to-1-line Multiplexer: n = 2 selection bits 2-to-2 2 -line decoder 2 2   2 AND-OR

30 Henry Hexmoor30 Multiplexer Width Expansion Select “vectors of bits” instead of “bits” Use multiple copies of 2 n  2 AND-OR in parallel Example: 4-to-1-line quad multi- plexer Figure 4-16

31 Henry Hexmoor31 Using Multiplexers Any Boolean function can be implemented by setting the inputs corresponding to the function as inputs and the selectors as the variables.

32 Henry Hexmoor32 Shifters

33 Henry Hexmoor33 Rotator

34 Henry Hexmoor34 Parity for six bit messages B 0 B 1 B 2 B 3 B 4 B 5 B 6 B even B 0 B 1 B 2 B 3 B 4 B 5 B 6 B even ERROR Even Parity Generator Circuit Even Parity Checker Circuit

35 Henry Hexmoor35 Example: Gray to Binary Code Design a circuit to convert a 3-bit Gray code to a binary code The formulation gives the truth table on the right It is obvious from this table that X = C and the Y and Z are more complex

36 Henry Hexmoor36 Gray to Binary (continued) Rearrange the table so that the input combinations are in counting order, pair rows, and find rudimentary functions Gray A B C Binary x y z Rudimentary Functions of C for y Rudimentary Functions of C for z F = C

37 Henry Hexmoor37 Assign the variables and functions to the multiplexer inputs: Gray to Binary (continued) S1 S0 A B D03 D02 D01 D00 Out Y 8-to-1 MUX C C C C D13 D12 D11 D10 Out Z 8-to-1 MUX S1 S0 A B C C C C C C

38 Henry Hexmoor38 Combinational Function Implementation 4-6 Alternative implementation techniques: –Decoders and OR gates –Multiplexers (and inverter) –ROMs –PLAs –PALs –Lookup Tables Can be referred to as structured implementation methods since a specific underlying structure is assumed in each case

39 Henry Hexmoor39 Read Only Memory Functions are implemented by storing the truth table Other representations such as equations more convenient Generation of programming information from equations usually done by software Text Example 4-10 Issue –Two outputs are generated outside of the ROM –In the implementation of the system, these two functions are “hardwired” and even if the ROM is reprogrammable or removable, cannot be corrected or updated

40 Henry Hexmoor40 Programmable Logic Array Example XFuse intact 1 Fuse blown 0 1 F 1 F 2 A B C CBACBA X X XX X X X X X X X X X X X X X X

41 Henry Hexmoor41 Lookup Tables Lookup tables are used for implementing logic in Field-Programmable Gate Arrays (FPGAs) and Complex Logic Devices (CPLDs) Lookup tables are typically small, often with four inputs, one output, and 16 entries Since lookup tables store truth tables, it is possible to implement any 4-input function Thus, the design problem is how to optimally decompose a set of given functions into a set of 4-input two- level functions.

42 Henry Hexmoor42 HW 4 1.Draw the detailed logic diagram of a 3-to-8- line decoder using only NOR and NOT gates. Include an enable input. Q4-9 2.Implement a binary full adder with a dual 4- to-1-line multiplexer and a single inverter. Q4-23


Download ppt "Henry Hexmoor1 C hapter 4 Henry Hexmoor-- SIUC Rudimentary Logic functions: Value fixing Transferring Inverting."

Similar presentations


Ads by Google