Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Fundamentals of Computer Science Combinational Circuits.

Similar presentations


Presentation on theme: "1 Fundamentals of Computer Science Combinational Circuits."— Presentation transcript:

1 1 Fundamentals of Computer Science Combinational Circuits

2 2 What is a Combinational Circuit? Logic circuits for digital systems may be classified as either combinational or sequential. A combinational circuit consists of logic gates whose output(s) at any time are based exclusively on the values of external inputs. Combinational Circuit............ inputs outputs

3 3 What is a Sequential Circuit? A sequential circuit consists of logic gates whose output(s) at any time are based on the values of external input(s) and internally generated input(s). Sequential circuits are used to implement memory elements. Sequential Circuit........ inputs outputs

4 4 Predefined Circuits In programming there are certain functions that are so commonly used across different software systems that they are packaged in libraries of routines that are included with program translators. In this way programmers do not constantly have to “reinvent the wheel”. In hardware design there are certain circuits that are so commonly used across different hardware systems that they are manufactured in advanced and used as needed as building blocks in larger hardware systems. We will look at several of these circuits in this section.

5 5 Multiplexors A multiplexor is a combinational circuit that selects binary information from one of many lines (D) and directs the information to a single output line. The signal selected is determined by a set of input variables called selectors (S). 4-to-1 Multiplexor D0D0 Y D1D1 D2D2 D3D3 S1S1 S0S0

6 6 Implementation of 4-to-1 Line Multiplexor

7 7 Demultiplexors A demultiplexor is a combinational circuit that routs binary information from a single data line and directs the information to one of several output lines. The output line is determined by a set of input variables called selectors (S). A demultiplexor doubles as a decoder with enable. 1-to-4 Demultiplexor D0D0 Enable / Data D1D1 D2D2 D3D3 S1S1 S0S0

8 8 Implementation of 1-to-4 Line Demultiplexor S 1 S 0 D 3 D 2 D 1 D 0 0 0 0 0 0 E 0 1 0 0 E 0 1 0 0 E 0 0 1 1 E 0 0 0

9 9 Decoder A decoder is a combinational circuit that converts binary information from n coded inputs to a maximum of 2 n unique outputs. 3-to-8 Decoder D0D0 D1D1 D2D2 D3D3 A0A0 D4D4 D5D5 D6D6 D7D7 A1A1 A2A2

10 10 Implementation of 3-to-8 Line Decoder

11 11 Encoder A encoder is a combinational circuit that performs the inverse operation of a decoder. It will have 2 n or fewer input lines and n outputs. At any given time only one of the input lines will be high. If multiple inputs are high, the circuit will perform improperly. 8-to-3 Encoder D0D0 D1D1 D2D2 D3D3 A0A0 A1A1 D4D4 D5D5 D6D6 D7D7 A2A2

12 12 Octal to Binary Encoder Truth table for an octal to binary encoder.

13 13 Priority Encoder A priority encoder allows for the possibility that multiple inputs will be high simultaneously. –Each input is assigned a fixed priority, if multiple inputs are high simultaneously the one with the highest priority will determine the output of the encoder Truth table for an base four to binary encoder with a valid output indicator, V. –This is an example of a condensed truth table.

14 14 Priority Encoder Simplification of a base four to binary priority encoder.

15 15 Full Adder A full adder is a combinational circuit that sums three 1-bit binary numbers. Full adders are typically connected in series via their C IN and C OUT lines in order to sum two multi- digit binary numbers. –C stands for carry. Full Adder A0A0 C IN B0B0 S0S0 C OUT

16 16 Simplification of Carry Out Function in Full Adder

17 17 Simplification of Significant Digit Function in Full Adder

18 18 4-Bit Ripple Carry Adder Ripple Carry Adders suffer from propagation delay. This is a major problem if the adder is large.

19 19 Propagation Delay for an Inverter Gate

20 20 4-Bit Carry Lookahead Adder Carry Lookahead Adders are used to reduce the amount of propagation delay during addition of large values.

21 21 2’s Complement Representation Most modern computers use 2’s complement representation to store signed integers. The high-order bit of an integer stored in 2’s complement representation will contain a 0 if the number is positive and a 1 if the number is negative. By taking the 2’s complement of an integer you are effectively multiplying the number by -1. –The 2’s complement of a positive integer results in its negative representation. –The 2’s complement of a negative integer results in its absolute value.

22 22 2’s Complement Representation Taking the 2’s complement of an integer is a 2-step process. –Step 1 - Flip all the bits in the number (0’s become 1’s and 1’s become 0’s). This is also known as taking the 1’s complement of the number. –Step 2 - Add 1 to the 1’s complement representation of the number). In the process of adding 1, any carry out of the high-order position is lost. This is normal and not a problem in the world of computer arithmetic.

23 23 2’s Complement Representation Assume we are storing a positive 9 in a one-byte (8- bit field) using 2’s complement representation. In binary it would appear as 00001001. Now, take the 2’s complement of the number. –Step 1 - flip the bits. 11110110 –Step 2 - add 1. + 1 11110111 The result, 11110111, is the 2’s complement representation of -9. If we were to take the 2’s complement of 11110111 (-9), we would get 00001001 (+9).

24 24 2’s Complement Arithmetic To confirm that 11110111 really does represent -9, we should be able to add it to +9 and get a result of 0. Remember we are doing binary addition: 1 + 1 = 10. 11110111 (-9) + 00001001 (+9) 00000000 (0) As pointed out earlier, a carry out of the high-order position is lost.

25 25 Adder-Subtractor Circuit Most ALUs do not have a separate set of integer subtraction circuitry. Instead, subtraction is performed in terms of addition. For example, A - B would be performed as A + (-B). If S is high B is subtracted from A. If S is low B is added to A.

26 26 Carry-Overflow Detection If the carry out of the high-order bit (C n ) is different from the carry into the high-order bit (C n-1 ) then overflow (V) has occurred. –Overflow detection is significant when doing arithmetic on signed numbers. C is equal to the value of C n. –Carry detection is significant when doing arithmetic on unsigned numbers.


Download ppt "1 Fundamentals of Computer Science Combinational Circuits."

Similar presentations


Ads by Google