4 Combinational Components

Size: px
Start display at page:

Download "4 Combinational Components"

Transcription

1 Chapter 4 Combinational Components Page of 8 4 Combinational Components In constructing large digital circuits, instead of starting with the basic gates as building blocks, we often start with larger building blocks. As with man construction problems, it is much easier to build in a hierarchical fashion. In this chapter, we describe some combinational logic components that are often used as building blocks for large digital circuits. These components are usuall available in standard libraries. 4. Adder / Subtractor 4.. Full Adder To construct an adder for adding two binar numbers, X = x n- x 0 and Y = n- 0, we need to first consider the addition of a single bit slice x i with i, together with the carr-in bit c i from the previous bit position. The result from this addition is a sum bit s i and a carr-out bit c i+ for the next bit position. Hence, s i = x i + i + c i, and c i+ = if there is a carr from the addition to the next bit. The circuit for the addition of this single bit slice is known as a full adder (FA) and its truth table is shown in Figure. The equations for s i and c i+ are derived as follows: s i = x i '''c i + x i ' i c i ' + x i i 'c i ' + x i i c i = (x i ' i + x i i ')c i ' + (x i ' i ' + x i i )c i = (x i i )c i ' + (x i i )'c i = x i i c i c i+ = x i ' i c i + x i i 'c i + x i i c i ' + x i i c i = x i i (c i ' + c i ) + c i (x i ' i + x i i ') = x i i + c i (x i i ) From these two equations, we get the circuit for the full adder as shown in Figure. Figure shows the logic smbol for the full adder. The dataflow VHDL code for the full adder is shown in Figure Ripple Carr Adder The full adder is for adding two operands that are onl one bit wide. To add two operands that are, sa eight bits wide we connect eight full adders together in series. The resulting circuit, shown in Figure 3, is called a ripple carr adder for adding two eight-bit operands. Since the FA adds the three bits x i, i and c i together, we need to set c 0 to be 0 in order to perform the addition correctl. Moreover, c out is asserted when there is an overflow for an unsigned addition. x i i c i c i+ s i c i+ x i i c i x i i c i+ FA s i c i s i Figure. Full adder: truth table; circuit; logic smbol.

2 Chapter 4 Combinational Components Page 2 of 8 ENTITY FullAdder IS PORT(x: IN std_logic; : IN std_logic; cin: IN std_logic; sum: OUT std_logic; cout: OUT std_logic); END FullAdder; ARCHITECTURE Dataflow OF FullAdder IS signal m,m2,m4,m7 : std_logic ; m <= (not x AND not AND c); m2 <= (not x AND AND not c); m4 <= (x AND not AND not c); m7 <= (x AND AND c); sum <= m OR m2 OR m4 OR m7; cout <= (x AND ) OR (cin AND (x OR )); END Dataflow; Figure 2. Dataflow VHDL code for a -bit full adder. x 7 7 x 6 6 x 5 5 x 4 4 x 3 3 x 2 2 x x 0 0 c out FA c 7 FA c 6 FA c 5 FA c 4 FA c 3 FA c 2 FA c FA c 0 s 7 s 6 s 5 s 4 s 3 s 2 s s 0 Figure 3. Ripple carr adder Carr-Lookahead Adder The ripple carr adder is slow because the carr-in for each bit slice is dependent on the carr-out signal from the previous bit slice. So before bit slice i can output valid data, it must wait for bit slice i - to have valid data. In the carr-lookahead adder each bit slice eliminates this dependenc on the previous carr-out signal, and instead uses the values of the two operands X and Y directl to deduce the needed signals. This is possible from the following observations regarding the carr-out signal. For each bit slice i, the carr-out signal c i+ is asserted if either one of the following two conditions is true: x i = and i = or (x i = or i = ) and c i = In other words, c i+ = (x i i ) + [(x i + i ) c i ]. (4.) If we let and g i = x i i p i = x i + i,

3 Chapter 4 Combinational Components Page 3 of 8 then equation 4. can be rewritten as c i+ = g i + p i c i. (4.2) Using this general equation for c i+, we can recursivel expand it to get the equation for an bit slice i that is dependent onl on the two input operands X and Y, and c 0. Using this technique, we get the following carr equations for the first four bit slices: c = g 0 + p 0 c 0 (4.3) c 2 = g + p c = g + p (g 0 + p 0 c 0 ) = g + p g 0 + p p 0 c 0 (4.4) c 3 = g 2 + p 2 c 2 = g 2 + p 2 (g + p g 0 + p p 0 c 0 ) = g 2 + p 2 g + p 2 p g 0 + p 2 p p 0 c 0 (4.5) c 4 = g 3 + p 3 c 3 = g 3 + p 3 (g 2 + p 2 g + p 2 p g 0 + p 2 p p 0 c 0 ) = g 3 + p 3 g 2 + p 3 p 2 g + p 3 p 2 p g 0 + p 3 p 2 p p 0 c 0 (4.6) Note that each equation is translated to a three level combinational logic one level for generating the g i and p i, and two levels (sum-of-products) for generating the c i expression. The circuit for generating the carr-lookahead signals up to c 4 is shown in Figure 4. The full adder (FA) for the carr-lookahead adder can also be made simpler since it no longer required to generate the c out signal for the next bit slice. In other words, the c in signal for the FA now comes from the new carrlookahead circuit rather than from the c out signal of the previous bit slice. Thus, this full adder onl requires to generate the sum i signal. Figure 4 shows one bit slice of the carr-lookahead adder. For an n-bit carr-lookahead adder, we use n bit slices. These n bit slices are not connected in series as with the ripple-carr adder. x 3 3 x 2 2 x x 0 0 g 3 p 3 g 2 p 2 g p g 0 p 0 x i i x 0 -x i- 0 - i- c 0 carrlookahead circuit c i FA c 4 c 3 c 2 c sum i Figure 4. Circuit for generating the carr-lookahead signals c to c 4. One bit slice of the carr-lookahead adder.

4 Chapter 4 Combinational Components Page 4 of Full Subtractor We can construct a one-bit subtractor circuit similar to the method used for constructing the full adder. However, instead of the sum bit s i from the addition, we have a difference bit d i from the subtraction, and instead of having a carr-in and carr-out signals, we have a borrow-in (b i ) and borrow-out (b i+ ) signals. Hence, d i = x i - i - b i, and b i+ = if we need to borrow for the subtraction. The truth table for the full subtractor (FS) is shown in Figure 5, from which the equations (4.7) for d i and (4.8) for b i+ are derived. x i i x i i b i b i+ d i b i+ b i x i i b i+ FS d i b i Figure 5. Full subtractor: truth table; circuit; logic smbol. d i d i = x i '''b i + x i ' i b i ' + x i i 'b i ' + x i i b i = (x i ' i + x i i ')b i ' + (x i ' i ' + x i i )b i = (x i i )b i ' + (x i i )'b i = x i i b i (4.7) b i+ = x i ' i 'b i + x i ' i b i ' + x i ' i b i + x i i b i = x i 'b i ( i ' + i ) + x i ' i (b i ' + b i ) + i b i (x i ' + x i ) = x i 'b i + x i ' i + i b i (4.8) From these two equations, we get the circuit for the full subtractor as shown in Figure 5. Figure 5 shows the logic smbol for the full subtractor Adder / Subtractor Combination It turns out that instead of having to build a separate adder and subtractor units, we can modif the ripple-carr adder (or the carr-lookahead adder) slightl to perform both operations. The modified circuit performs subtraction b adding the negated value of the second operand. Recall that to negate a value in two s complement representation, we simpl invert all the bits from 0 to and vice versa, and then add a. In addition to the two input operands A and B, a select signal S is used to select which operation to perform according to the truth table in Figure 6. When the subtraction operation is selected, i.e. S =, the B operand needs to be inverted. Recalling that x = x', we can thus simpl flip the bits in B b performing the operation B S since S =. Finall, the addition of a is accomplished b setting the primar carr-in signal c 0 to. On the other hand, when the addition operation is selected, i.e. S = 0, the B operand will not be inverted b the XOR operation. In this case, we also want c 0 = S = 0. An 8-bit adder / subtractor combination circuit is shown in Figure 6 and the logic smbol in. The behavioral VHDL code is shown in Figure 7.

5 Chapter 4 Combinational Components Page 5 of 8 S Function Operation 0 Add F = A + B Subtract F = A + B' + S c out A B Adder/Subtractor F 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 0 b 0 S c out FA c 7 FA c 6 FA c 5 FA c 4 FA c 3 FA c 2 FA c FA c 0 f 7 f 6 f 5 f 4 f 3 f 2 f f 0 Figure 6. Two s complement adder/subtractor combination: truth table; circuit; logic smbol. librar ieee; use ieee.std_logic_64.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; ENTITY AddSub IS GENERIC(n: NATURAL :=8); -- default number of bits = 8 PORT(A: IN std_logic_vector(n- downto 0); B: IN std_logic_vector(n- downto 0); subtract: IN std_logic; carr: OUT std_logic; sum: OUT std_logic_vector(n- downto 0)); END AddSub; ARCHITECTURE Behavioral OF AddSub IS -- temporar result with one extra bit for carr SIGNAL result: std_logic_vector(n downto 0); PROCESS(subtract, A, B) IF (subtract = '0') THEN -- addition --add the two operands with one extra bit for carr result <= ('0' & A)+('0' & B); sum <= result(n- downto 0); -- extract the n-bit result carr <= result(n); -- extract the carr bit from result ELSE -- subtraction result <= ('0' & A)-('0' & B); sum <= result(n- downto 0); -- extract the n-bit result carr <= result(n); END IF; END Behavioral; -- extract the borrow bit from result Figure 7. Behavioral VHDL code for an 8-bit adder / subtractor combination component.

6 Chapter 4 Combinational Components Page 6 of Arithmetic Logic Unit The arithmetic logic unit (ALU) is one of the main component inside a microprocessor that is responsible for performing arithmetic and logic operations such as addition, subtraction, logical AND, and logical OR. It turns out that in constructing the circuit for the ALU, we can use the same idea as for constructing the adder/subtractor combination circuit discussed in the previous section. Again, we will use the ripple-carr adder as the building block and then insert some combinational logic circuitr in front of the two input operands to each full adder. This wa, the primar inputs will be modified accordingl depending on the operations being performed before being passed to the full adder. The general overall circuit for a 4-bit ALU is shown in Figure 8. As we can see in the figure, the two combinational circuits in front of the full adder (FA) are labeled LE and AE. The LE (for logic extender) is for manipulating all logical operations, whereas, the AE (for arithmetic extender) is for manipulating all arithmetic operations. The LE performs the actual logical operations on the two primar operands a i and b i before passing the result to the first operand x i of the FA. On the other hand, the AE onl modifies the second operand b i and passes it to the second operand i of the FA where the actual arithmetic operation is performed. a 3 b 3 a 2 b 2 a b a 0 b 0 S 2 S S 0 LE AE LE AE LE AE LE AE x 3 3 x 2 2 x x 0 0 Unsigned Overflow c 4 FA c 3 FA c 2 FA c FA c 0 CE Signed Overflow f 3 f 2 f f 0 Figure 8. 4-bit ALU circuit. We saw from the adder/subtractor circuit that to perform additions and subtractions, we onl need to modif i, the second operand to the FA, so that all operations can be done with additions. Thus, the AE onl takes the second operand of the primar input b i as its input and modifies the value depending on the operation being performed. Its output is i and is connected to the second operand input of the FA. As in the adder/subtractor circuit, the addition is performed in the FA. When arithmetic operations are being performed, the LE must pass the first operand unchanged from the primar input a i to x i for the FA. Unlike the AE where it onl modifies the operand, the LE performs the actual logical operations. Thus, for example, if we want to perform the operation A OR B, the LE for each bit slice will take the corresponding bits a i and b i, and OR them together. Hence, one bit from both operands, a i and b i, are inputs to the LE. The output of the LE is passed to the first operand x i of the FA. Since this value is alread the result of the logical operation, we do not want the FA to modif it, but to simpl pass it on to the primar output f i. This is accomplished b setting both the second operand i of the FA, and c 0 to zero since adding a zero will not change the resulting value. The combinational circuit labeled CE is for modifing the primar carr-in signal c 0 so that arithmetic operations are performed correctl. Logical operations do not use the carr signal, so c 0 is set to zero for all logical operations. In the figure, three select lines, S 2, S, and S 0 are used to select the operations of the ALU. The S 2 line selects between the arithmetic operations and the logical operations. When S 2 =, arithmetic operations are selected, and

7 Chapter 4 Combinational Components Page 7 of 8 when S 2 = 0, logical operations are selected. The two select lines S and S 0 allow the selection of one among four possible arithmetic operations or four logical operations. Thus, our ALU circuit can implement eight different operations. Suppose that the operations that we want to implement in our ALU are as defined in Figure 9. The X column shows the values that the LE must generate for the different operations. The Y column shows the values that the AE must generate. The c 0 column shows the carr signals that the CE must generate. For example, for the pass through operation, the value of A is passed through without an modifications to X. For the AND operation, X gets the result of A AND B. As mentioned before, both Y and c 0 are set to zero for all the logical operations because we do not want the FA to change the results. The FA is onl used to pass the results from the LE straight through to the output F. For the subtraction operation, instead of subtracting B, we want to add B. Changing B to B in two s complement format requires flipping the bits of B and then adding a one. Thus, Y gets the inverse of B and the one is added through the carr-in c 0. To increment A, we set Y to all zeros and add the one through the carr-in c 0. To decrement A, we add a negative one instead. Negative one in two s complement format is a bit string with all one s. Hence, we set Y to all one s and the carr-in c 0 to zero. For all the arithmetic operations, we need the first operand A unchanged for the FA. Thus, X gets the value of A for all arithmetic operations. Figure 9, and (d) show the truth tables for the LE, AE and CE respectivel. The LE circuit is derived from the x i column of Figure 9; the AE circuit is derived from the i column of Figure 9; and the CE circuit is derived from the c 0 column of Figure 9(d). The K- maps, equations, and schematics for these three circuits are shown in Figure 0. Notice that x i is dependent on five variables, S 2, S, S 0, a i, and b i, whereas, i is dependent on onl four variables, S 2, S, S 0, and b i, and c 0 is dependent on onl the three select lines S 2, S, and S 0. The behavioral VHDL code for the ALU is shown in Figure and the simulation waveform for all operations using the two inputs 5 and 3 is shown in Figure 2. S 2 S S 0 Operation Name Operation X (LE) Y (AE) c 0 (CE) Pass through A Pass A to output A AND A AND B A AND B OR A OR B A OR B NOT A A' A' Addition A + B A B 0 0 Subtraction A B A B 0 Increment A A + A all 0 s Decrement A A A all s 0 S 2 S S 0 x i S 2 S S 0 b i i S 2 S S 0 c a i a i b i a i + b i a i ' a i (d) Figure 9. ALU operations: function table; LE truth table; AE truth table; (d) CE truth table.

8 Chapter 4 Combinational Components Page 8 of 8 a i b i x i S 2 = 0 a i b i S S S 2 = S 2 S S LE x i x i = S 2 a i + S 0 'a i + S 'a i b i + S 2 'S S 0 a i ' + S 2 'S a i ' b i = S 2 a i + S 0 'a i + S 'a i b i + S 2 'S a i ' (S 0 + b i ) b i i S S 0 b i S 0 S 2 S 2 S AE i i = S 2 S S 0 + S 2 S 0 b i ' + S 2 S 'S 0 'b i = S 2 S 0 (S + b i ') + S 2 S 'S 0 'b i c 0 S S S 2 S 0 S c 0 CE S 2 c 0 = S 2 S 'S 0 + S 2 S S 0 ' = S 2 (S S 0 ) Figure 0. K-maps, equations, and schematics for: LE; AE; and CE.

9 Chapter 4 Combinational Components Page 9 of 8 LIBRARY ieee; USE ieee.std_logic_64.all; -- The following package is needed so that the STD_LOGIC_VECTOR signals -- A and B can be used in unsigned arithmetic operations. USE ieee.std_logic_unsigned.all; ENTITY alu IS PORT (S: IN std_logic_vector(2 downto 0); -- select for operations A, B: IN std_logic_vector(3 downto 0); -- input operands F: OUT std_logic_vector(3 downto 0)); -- output END alu; ARCHITECTURE Behavior OF alu IS PROCESS(S, A, B) CASE S IS WHEN "000" => -- pass A through F <= A; WHEN "00" => -- AND F <= A AND B; WHEN "00" => -- OR F <= A OR B; WHEN "0" => -- NOT A F <= NOT A; WHEN "00" => -- add F <= A + B; WHEN "0" => -- subtract F <= A - B; WHEN "0" => -- increment F <= A + ; WHEN OTHERS => -- decrement F <= A - ; END CASE; END PROCESS; END Behavior; Figure. Behavioral VHDL code for an ALU. Pass A AND OR NOT A Add Subtract Increment Decrement Figure 2. Waveform generated for the two input operands 5 and 3 for all of the eight operations.

10 Chapter 4 Combinational Components Page 0 of Multiplexer The multiplexer, or mux for short, allows the selection of one input signal among n signals, where n > and is usuall a power of two. Select lines connected to the multiplexer determine which input signal is selected and passed to the output of the multiplexer. In general, an n-to- multiplexer has n input lines, s = log 2 n select lines, and one output line. For a 2-to- multiplexer, there is one select line s to select between the two inputs, d 0 and d. When s = 0, the input line d 0 is selected, and the data present on d 0 is passed to the output. When s =, the input line d is selected and the data on d is passed to. The truth table, circuit and the logic smbol for a 2-to- mux are shown in Figure 3. Constructing a larger size mux such as the 8-to- mux can be done similarl. Besides having eight input lines, the 8-to- mux of course has three select lines. Depending on the value of the three select lines, one of the eight input lines will be selected and the data on that input line will be passed to the output. For example, if the value of the select lines is 0, then the input line d 5 is selected and so the data that is present on d 5 will be passed to the output. The truth table, circuit, and logic smbol for the 8-to- mux is shown in Figure 4. Larger multiplexers can also be constructed from smaller multiplexers. For example, an 8-to- mux can be constructed using seven 2-to- muxes as shown in Figure 5. Another wa to implement an 8-to- mux is to use a 3-to-8 decoder to enable one of the eight AND gates as shown in Figure 5. The behavioral and dataflow VHDL code for an 8-bit wide 4-to- multiplexer is shown in Figure 6. Two different implementations of the same multiplexer is shown, the first implementation uses a process statement and the second uses a concurrent assignment statement. s d d Figure 3. A 2-to- multiplexer: truth table; circuit; logic smbol. d 0 s d s d d 0 0 d 7 d 6 d 5 d 4 d 3 d 2 d d 0 s 2 s 2 s s d d 0 0 d 2 0 d d 4 0 d 5 0 d 6 d 7 s s 0 s 2 s s 0 d d 0 d 2 d 3 d 4 d 5 d 6 d Figure 4. An 8-to- multiplexer: truth table; circuit; logic smbol.

11 Chapter 4 Combinational Components Page of 8 d 6 d 7 d 4 d 5 d 2 d 3 d 0 d s s s s s 0 s s 2 Decoder d 7 d 6 d 5 d 4 d 3 d 2 d d 0 s 0 0 s 0 s s s 2 0 s Figure 5. An 8-to- multiplexer implemented using: seven 2-to- multiplexers; a decoder. -- A 4-to- 8-bit multiplexer LIBRARY ieee; USE IEEE.std_logic_64.all; ENTITY Multiplexer IS PORT(S: IN std_logic_vector( downto 0); -- select lines D0, D, D2, D3: IN std_logic_vector(7 downto 0); -- data bus input Y: OUT std_logic_vector(7 downto 0)); -- data bus output END Multiplexer; -- using a process statement ARCHITECTURE Behavioral OF Multiplexer IS PROCESS (S,D0,D,D2,D3) CASE S IS WHEN "00" => Y <= D0; WHEN "0" => Y <= D; WHEN "0" => Y <= D2; WHEN "" => Y <= D3; WHEN OTHERS => Y <= (OTHERS => 'U'); END CASE; END PROCESS; END Behavioral; -- using a concurrent assignment statement ARCHITECTURE Dataflow OF Multiplexer IS WITH S SELECT Y <= D0 WHEN "00", D WHEN "0", D2 WHEN "0", D3 WHEN "", (OTHERS => 'U') WHEN OTHERS; END Dataflow; -- 8-bit vector of U -- 8-bit vector of U Figure 6. VHDL code for an 8-bit wide 4-to- multiplexer.

12 Chapter 4 Combinational Components Page 2 of Tri-state Buffer A tri-state buffer, as the name suggests, has three states: 0, and a third state denoted b Z. The value Z represents a high-impedance state, which for all practical purposes acts like a switch that is opened or a wire that is disconnected. A tri-state buffer is used to connect devices to the same bus. A bus, of course, is one or more wire for transferring signals. If two or more devices are connected directl to a bus without using tri-state buffers, signals will get corrupted on the bus because the devices are alwas outputting either a 0 or a. However, with a tri-state buffer in between, devices that do not need to use the bus can disable the tri-state buffer so that it acts as if those devices are phsicall disconnected from the bus. At an one time, onl one active device will have its tri-state buffers enabled and thus use the bus. The truth table and smbol for the tri-state buffer is shown in Figure 7 and. The enable pin E turns the buffer on or off. When E is de-asserted with a 0, the tri-state buffer is disabled and the output is in its highimpedance Z state. When E is asserted with a, the buffer is enabled and the output follows the input d. The internal circuit for the tri-state buffer uses two discrete transistors in conjunction with basic gates to produce the high-impedance state. The circuit is shown in Figure 7. In order to understand how this circuit works, we need to understand how the two CMOS transistors operate and this is discussed in detail in section??. E Vcc E 0 Z d E d d Figure 7. Tri-state buffer: truth table; logic smbol; circuit. In Figure 7, the top p-mos transistor is turned on with a 0. When it is on, a signal from Vcc passes down through the transistor and output has a value. Conversel, the bottom n-mos transistor is turned on with a. When it is on, a 0 signal from ground passes up through the transistor to output. For both transistors, when the are turned off, their outputs are in the Z state. When E = 0, the output of the NAND gate is a regardless of what the other input is, and so the top p-mos transistor is turned off. Similarl, the output of the NOR gate is a 0, and so the bottom n-mos transistor is also turned off. Thus, when E = 0, both transistors are off and so the output is in the Z state. When E =, the outputs of both the NAND and NOR gates are equal to d'. So if d = 0, the output of the two gates are and so the bottom transistor is turned on while the top transistor is turned off. Thus will have the value 0, which is equal to d. On the other hand, if d =, the top transistor is turned on while the bottom transistor is turned off, and will have the value. The behavioral VHDL code for an 8-bit wide tri-state buffer is shown in Figure Decoder A decoder, also known as a demultiplexer, asserts one out of n lines depending on the value of an m bit binar number. In general, an m-to-n decoder has n output lines Y n-,, Y 0, and m = log 2 n input lines A m-,, A 0. In addition, it has an enable line E for enabling the decoder. When the decoder is disabled, all the output lines are deasserted. When the decoder is enabled, then the output line whose index is equal to the value of the input binar address is asserted. For example, for a 3-to-8 decoder, if the input address is 0, then the output line Y 5 is asserted (equals if active high) while the rest of the output lines are de-asserted. A decoder is used in a sstem having multiple components and onl one component is selected or enabled at an one time. For example, in a large memor sstem with multiple memor chips, onl one memor chip is enabled at a time. One output line from the decoder is connected to the enable input on each memor chip. An address presented to the decoder will thus enable that corresponding memor chip.

13 Chapter 4 Combinational Components Page 3 of 8 LIBRARY ieee; USE IEEE.std_logic_64.all; ENTITY TriState_Buffer IS PORT(E: IN std_logic; d: IN std_logic_vector(7 downto 0); : OUT std_logic_vector(7 downto 0)); END TriState_Buffer; ARCHITECTURE Behavioral OF TriState_Buffer IS PROCESS (E, d) -- get error message if no d IF (E = '') THEN <= d; ELSE <= (OTHERS => 'Z'); END IF; END PROCESS; END Behavioral; Figure 8. VHDL code for an 8-bit wide tri-state buffer. -- to get 8 Z values The truth table, circuit and logic smbol for a 3-to-8 decoder are shown in Figure 9. Similar to a multiplexer where a larger mux can be implemented using several smaller muxes, a larger decoder can also be implemented using several smaller decoders. For example, Figure 20 uses seven -to-2 decoders to implement a 3-to-8 decoder. The behavioral VHDL code for a 3-to-8 decoder is shown in Figure 2. E A 2 E A 2 A A 0 Y 7 Y 6 Y 5 Y 4 Y 3 Y 2 Y Y A A 0 Y 7 Y 6 Y 5 Y 4 Y 3 Y 2 Y Y 0 A 2 A A 0 E Y 2 Y Y 0 Y 3 Y 4 Y 5 Y 6 Y 7 Figure 9. A 3-to-8 decoder: truth table; circuit; logic smbol.

14 Chapter 4 Combinational Components Page 4 of 8 E A 2 A A 0 E 0 E 0 E 0 E 0 E 0 E 0 E 0 Y 7 Y 6 Y 5 Y 4 Y 3 Y 2 Y Y 0 Figure 20. A 3-to-8 decoder implemented with seven -to-2 decoders -- A 3-to-8 decoder LIBRARY ieee; USE IEEE.std_logic_64.all; ENTITY Decoder IS PORT(E: IN std_logic; -- enable A: IN std_logic_vector(2 downto 0); -- 3 bit address Y: OUT std_logic_vector(7 downto 0)); -- data bus output END Decoder; ARCHITECTURE Behavioral OF Decoder IS PROCESS (E, A) IF (E = '0') THEN -- disabled Y <= (OTHERS => '0'); -- 8-bit vector of 0 ELSE CASE A IS -- enabled WHEN "000" => Y <= " "; WHEN "00" => Y <= " "; WHEN "00" => Y <= " "; WHEN "0" => Y <= " "; WHEN "00" => Y <= " "; WHEN "0" => Y <= " "; WHEN "0" => Y <= " "; WHEN "" => Y <= " "; END CASE; END IF; END PROCESS; END Behavioral; Figure 2. Behavioral VHDL code for a 3-to-8 decoder. 4.6 Encoder

15 Chapter 4 Combinational Components Page 5 of Comparator Quite often we need to compare two values for their arithmetic relationship (equal, greater, less than, etc.). A comparator is a circuit that compares two binar words and indicates whether the relationship is true or not. To compare whether a value is equal or not equal to a constant value, a simple AND gate can be used. For example, to compare a 4-bit variable x with the constant 3, the circuit in Figure 22 can be used. The AND gate outputs a when the input is equal to the value 3. The XOR and XNOR gates can be used for comparing for inequalit and equalit respectivel between two values. The XOR gate outputs a when the two input values are different. A 4-bit inequalit comparator is shown in Figure 22. The circuit outputs a if x To compare for the greater or less than relationships, we can construct a truth table and build the circuit from it. For example, to compare whether a 3-bit value x is less than five, we get the following truth table. The circuit is shown in Figure 22. x 2 x x 0 F ( < 5 ) x 3 x 2 x x 0 x 3 3 x 2 x 2 x x 0 2 x F F x 0 0 Figure 22. Simple comparators for x = 3; x ; x < 5. F Instead of constructing a comparator for a fixed number of bits for the input values, we can construct an iterative circuit b constructing a -bit slice comparator and then dais chaining them together for as man bits as is needed. The -bit slice comparator will have, in addition to the two operand bits x i and i, a p i bit that keeps track of whether all the previous bit pairs compared so far are true or not for that particular relationship. The circuit outputs a if p i = and the relationship is true for the current bit pair x i and i. Figure 23 shows a -bit slice comparator for equalit. If the current bit pair x i and i are equal, the XNOR gate will output a. Hence, p i+ = if the current bit pair is equal and the previous bit pair p i =. To obtain a 4-bit iterative equalit comparator, we connect four -bit equalit comparators in series as shown in Figure 23. The initial p 0 bit is set to a. Thus, if all four bit-pairs are equal, then the last bit, p 4 will be a, otherwise, p 4 will be a 0. x i i EQ x 3 3 x 2 2 x x 0 0 p pi i+ Figure 23. Iterative comparators: -bit slice for x i = i ; 4-bit x =. p 4 EQ p 3 EQ p 2 EQ p EQ p 0 ''

16 Chapter 4 Combinational Components Page 6 of Shifter / Rotator The shifter and the rotator are used for shifting bits in a binar word one position either to the left or to the right. The difference between the shifter and the rotator is in how the end bits are shifted in or out. The six different operations for the shifter / rotator are summarized in Figure 24. For each bit position, a multiplexer is used to move a bit from either the left or right to the current bit position. The size of the multiplexer will determine the number of operations that can be implemented. For example, we can use a 4-to- mux to implement the four operations as specified b the table in Figure 25. Two select lines, S and S 0, are needed to select between the four different operations. For a 4-bit operand, we will need to use four 4-to- muxes as shown in Figure 25. How the inputs to the muxes are connected will depend on the given operations. In the example, when S = S 0 = 0, we want to pass the bit straight through without shifting, i.e. we want the value for in i to pass to out i. Given S = S 0 = 0, d 0 of the mux is selected, hence, in i is connected to d 0 of mux i which outputs to out i. For S = 0 and S 0 =, we want to shift left, i.e. we want the value for in i to pass to out i+. With S = 0 and S 0 =, d of the mux is selected, hence, in i is connected to d of mux i+ which outputs to out i+. For this selection, we also want to shift in a bit, so d of mux 0 is connected directl to a. The behavioral VHDL code for an 8-bit shifter / rotator having the functions as defined in Figure 25 is shown in Figure 26. Operation Comment Example Shift left with 0 Shift bits to the left one position. The leftmost bit is discarded and the rightmost bit is filled with a Shift left with Shift right with 0 Shift right with Rotate left Rotate right Same as above except that the rightmost bit is filled with a. Shift bits to the right one position. The rightmost bit is discarded and the leftmost bit is filled with a 0. Same as above except that the leftmost bit is filled with a. Shift bits to the left one position. The leftmost bit is moved to the rightmost bit position. Shift bits to the right one position. The rightmost bit is moved to the leftmost bit position Figure 24. Shifter and rotator operations.

17 Chapter 4 Combinational Components Page 7 of 8 S S 0 Operation 0 0 Pass through 0 Shift left with 0 Shift right with 0 Rotate right '0' 3 s s0 in 3 in 2 in in mux 3 3 s s0 2 0 mux 2 3 s s0 2 0 mux 3 s s0 2 0 mux 0 '' S S 0 out 3 out 2 out out 0 S S 0 in 3 in 2 in in 0 4-bit shifter/rotator out 3 out 2 out out 0 Figure 25. A 4-bit shifter / rotator: operation table; circuit; logic smbol. LIBRARY ieee; USE ieee.std_logic_64.all; USE ieee.std_logic_unsigned.all; ENTITY shifter IS PORT (SHSel: IN std_logic_vector( downto 0); -- select for operations input: IN std_logic_vector(7 downto 0); -- input output: OUT std_logic_vector(7 downto 0)); -- output END shifter; ARCHITECTURE Behavior OF shifter IS process(shsel, input) begin CASE SHSel IS WHEN "00" => -- pass through output <= input; WHEN "0" => -- shift left with output <= input(6 downto 0) & ''; WHEN "0" => -- shift right with 0 output <= '0' & input(7 downto ); WHEN "" => -- rotate right output <= input(0) & input(7 downto ); END CASE; END PROCESS; END Behavior; Figure 26. Behavioral VHDL code for an 8-bit shifter / rotator having the operations as defined in Figure 25.

18 Chapter 4 Combinational Components Page 8 of Multiplier 4.0 Using ROMs to Implement Boolean Functions 4. Using PLAs to Implement Boolean Functions

5 Combinatorial Components. 5.0 Full adder. Full subtractor

5 Combinatorial Components. 5.0 Full adder. Full subtractor 5 Combatorial Components Use for data transformation, manipulation, terconnection, and for control: arithmetic operations - addition, subtraction, multiplication and division. logic operations - AND, OR,

More information

Sistemas Digitais I LESI - 2º ano

Sistemas Digitais I LESI - 2º ano Sistemas Digitais I LESI - 2º ano Lesson 6 - Combinational Design Practices Prof. João Miguel Fernandes (miguel@di.uminho.pt) Dept. Informática UNIVERSIDADE DO MINHO ESCOLA DE ENGENHARIA - PLDs (1) - The

More information

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language Chapter 4 Register Transfer and Microoperations Section 4.1 Register Transfer Language Digital systems are composed of modules that are constructed from digital components, such as registers, decoders,

More information

FORDHAM UNIVERSITY CISC 3593. Dept. of Computer and Info. Science Spring, 2011. The Binary Adder

FORDHAM UNIVERSITY CISC 3593. Dept. of Computer and Info. Science Spring, 2011. The Binary Adder FORDHAM UNIVERITY CIC 3593 Fordham College Lincoln Center Computer Organization Dept. of Computer and Info. cience pring, 2011 1 Introduction The Binar Adder The binar adder circuit is an important building

More information

Binary Adders: Half Adders and Full Adders

Binary Adders: Half Adders and Full Adders Binary Adders: Half Adders and Full Adders In this set of slides, we present the two basic types of adders: 1. Half adders, and 2. Full adders. Each type of adder functions to add two binary bits. In order

More information

Systems I: Computer Organization and Architecture

Systems I: Computer Organization and Architecture Systems I: Computer Organization and Architecture Lecture 9 - Register Transfer and Microoperations Microoperations Digital systems are modular in nature, with modules containing registers, decoders, arithmetic

More information

Let s put together a Manual Processor

Let s put together a Manual Processor Lecture 14 Let s put together a Manual Processor Hardware Lecture 14 Slide 1 The processor Inside every computer there is at least one processor which can take an instruction, some operands and produce

More information

NEW adder cells are useful for designing larger circuits despite increase in transistor count by four per cell.

NEW adder cells are useful for designing larger circuits despite increase in transistor count by four per cell. CHAPTER 4 THE ADDER The adder is one of the most critical components of a processor, as it is used in the Arithmetic Logic Unit (ALU), in the floating-point unit and for address generation in case of cache

More information

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng Digital Logic Design Basics Combinational Circuits Sequential Circuits Pu-Jen Cheng Adapted from the slides prepared by S. Dandamudi for the book, Fundamentals of Computer Organization and Design. Introduction

More information

COMBINATIONAL CIRCUITS

COMBINATIONAL CIRCUITS COMBINATIONAL CIRCUITS http://www.tutorialspoint.com/computer_logical_organization/combinational_circuits.htm Copyright tutorialspoint.com Combinational circuit is a circuit in which we combine the different

More information

Combinational Logic Design

Combinational Logic Design Chapter 4 Combinational Logic Design The foundations for the design of digital logic circuits were established in the preceding chapters. The elements of Boolean algebra (two-element switching algebra

More information

CHAPTER 3 Boolean Algebra and Digital Logic

CHAPTER 3 Boolean Algebra and Digital Logic CHAPTER 3 Boolean Algebra and Digital Logic 3.1 Introduction 121 3.2 Boolean Algebra 122 3.2.1 Boolean Expressions 123 3.2.2 Boolean Identities 124 3.2.3 Simplification of Boolean Expressions 126 3.2.4

More information

EXPERIMENT 4. Parallel Adders, Subtractors, and Complementors

EXPERIMENT 4. Parallel Adders, Subtractors, and Complementors EXPERIMENT 4. Parallel Adders, Subtractors, and Complementors I. Introduction I.a. Objectives In this experiment, parallel adders, subtractors and complementors will be designed and investigated. In the

More information

1. True or False? A voltage level in the range 0 to 2 volts is interpreted as a binary 1.

1. True or False? A voltage level in the range 0 to 2 volts is interpreted as a binary 1. File: chap04, Chapter 04 1. True or False? A voltage level in the range 0 to 2 volts is interpreted as a binary 1. 2. True or False? A gate is a device that accepts a single input signal and produces one

More information

Understanding Logic Design

Understanding Logic Design Understanding Logic Design ppendix of your Textbook does not have the needed background information. This document supplements it. When you write add DD R0, R1, R2, you imagine something like this: R1

More information

Chapter 2 Logic Gates and Introduction to Computer Architecture

Chapter 2 Logic Gates and Introduction to Computer Architecture Chapter 2 Logic Gates and Introduction to Computer Architecture 2.1 Introduction The basic components of an Integrated Circuit (IC) is logic gates which made of transistors, in digital system there are

More information

Combinational-Circuit Building Blocks

Combinational-Circuit Building Blocks May 9, 24 :4 vra6857_ch6 Sheet number Page number 35 black chapter 6 Combinational-Circuit Building Blocks Chapter Objectives In this chapter you will learn about: Commonly used combinational subcircuits

More information

ECE 3401 Lecture 7. Concurrent Statements & Sequential Statements (Process)

ECE 3401 Lecture 7. Concurrent Statements & Sequential Statements (Process) ECE 3401 Lecture 7 Concurrent Statements & Sequential Statements (Process) Concurrent Statements VHDL provides four different types of concurrent statements namely: Signal Assignment Statement Simple Assignment

More information

earlier in the semester: The Full adder above adds two bits and the output is at the end. So if we do this eight times, we would have an 8-bit adder.

earlier in the semester: The Full adder above adds two bits and the output is at the end. So if we do this eight times, we would have an 8-bit adder. The circuit created is an 8-bit adder. The 8-bit adder adds two 8-bit binary inputs and the result is produced in the output. In order to create a Full 8-bit adder, I could use eight Full -bit adders and

More information

ECE410 Design Project Spring 2008 Design and Characterization of a CMOS 8-bit Microprocessor Data Path

ECE410 Design Project Spring 2008 Design and Characterization of a CMOS 8-bit Microprocessor Data Path ECE410 Design Project Spring 2008 Design and Characterization of a CMOS 8-bit Microprocessor Data Path Project Summary This project involves the schematic and layout design of an 8-bit microprocessor data

More information

Digital Design with VHDL

Digital Design with VHDL Digital Design with VHDL CSE 560M Lecture 5 Shakir James Shakir James 1 Plan for Today Announcement Commentary due Wednesday HW1 assigned today. Begin immediately! Questions VHDL help session Assignment

More information

VHDL Test Bench Tutorial

VHDL Test Bench Tutorial University of Pennsylvania Department of Electrical and Systems Engineering ESE171 - Digital Design Laboratory VHDL Test Bench Tutorial Purpose The goal of this tutorial is to demonstrate how to automate

More information

DEPARTMENT OF INFORMATION TECHNLOGY

DEPARTMENT OF INFORMATION TECHNLOGY DRONACHARYA GROUP OF INSTITUTIONS, GREATER NOIDA Affiliated to Mahamaya Technical University, Noida Approved by AICTE DEPARTMENT OF INFORMATION TECHNLOGY Lab Manual for Computer Organization Lab ECS-453

More information

CSE140 Homework #7 - Solution

CSE140 Homework #7 - Solution CSE140 Spring2013 CSE140 Homework #7 - Solution You must SHOW ALL STEPS for obtaining the solution. Reporting the correct answer, without showing the work performed at each step will result in getting

More information

Flip-Flops, Registers, Counters, and a Simple Processor

Flip-Flops, Registers, Counters, and a Simple Processor June 8, 22 5:56 vra235_ch7 Sheet number Page number 349 black chapter 7 Flip-Flops, Registers, Counters, and a Simple Processor 7. Ng f3, h7 h6 349 June 8, 22 5:56 vra235_ch7 Sheet number 2 Page number

More information

Gates & Boolean Algebra. Boolean Operators. Combinational Logic. Introduction

Gates & Boolean Algebra. Boolean Operators. Combinational Logic. Introduction Introduction Gates & Boolean lgebra Boolean algebra: named after mathematician George Boole (85 864). 2-valued algebra. digital circuit can have one of 2 values. Signal between and volt =, between 4 and

More information

Lecture 12: More on Registers, Multiplexers, Decoders, Comparators and Wot- Nots

Lecture 12: More on Registers, Multiplexers, Decoders, Comparators and Wot- Nots Lecture 12: More on Registers, Multiplexers, Decoders, Comparators and Wot- Nots Registers As you probably know (if you don t then you should consider changing your course), data processing is usually

More information

12. A B C A B C A B C 1 A B C A B C A B C JK-FF NETr

12. A B C A B C A B C 1 A B C A B C A B C JK-FF NETr 2..,.,.. Flip-Flops :, Flip-Flops, Flip Flop. ( MOD)... -8 8, 7 ( ).. n Flip-Flops. n Flip-Flops : 2 n. 2 n, Modulo. (-5) -4 ( -), (-) - ( -).. / A A A 2 3 4 5 MOD-5 6 MOD-6 7 MOD-7 8 9 / A A A 2 3 4 5

More information

3.Basic Gate Combinations

3.Basic Gate Combinations 3.Basic Gate Combinations 3.1 TTL NAND Gate In logic circuits transistors play the role of switches. For those in the TTL gate the conducting state (on) occurs when the baseemmiter signal is high, and

More information

Gates, Circuits, and Boolean Algebra

Gates, Circuits, and Boolean Algebra Gates, Circuits, and Boolean Algebra Computers and Electricity A gate is a device that performs a basic operation on electrical signals Gates are combined into circuits to perform more complicated tasks

More information

CMOS Binary Full Adder

CMOS Binary Full Adder CMOS Binary Full Adder A Survey of Possible Implementations Group : Eren Turgay Aaron Daniels Michael Bacelieri William Berry - - Table of Contents Key Terminology...- - Introduction...- 3 - Design Architectures...-

More information

150127-Microprocessor & Assembly Language

150127-Microprocessor & Assembly Language Chapter 3 Z80 Microprocessor Architecture The Z 80 is one of the most talented 8 bit microprocessors, and many microprocessor-based systems are designed around the Z80. The Z80 microprocessor needs an

More information

LAB #3 VHDL RECOGNITION AND GAL IC PROGRAMMING USING ALL-11 UNIVERSAL PROGRAMMER

LAB #3 VHDL RECOGNITION AND GAL IC PROGRAMMING USING ALL-11 UNIVERSAL PROGRAMMER LAB #3 VHDL RECOGNITION AND GAL IC PROGRAMMING USING ALL-11 UNIVERSAL PROGRAMMER OBJECTIVES 1. Learn the basic elements of VHDL that are implemented in Warp. 2. Build a simple application using VHDL and

More information

Digital Electronics Detailed Outline

Digital Electronics Detailed Outline Digital Electronics Detailed Outline Unit 1: Fundamentals of Analog and Digital Electronics (32 Total Days) Lesson 1.1: Foundations and the Board Game Counter (9 days) 1. Safety is an important concept

More information

Quartus II Introduction for VHDL Users

Quartus II Introduction for VHDL Users Quartus II Introduction for VHDL Users This tutorial presents an introduction to the Quartus II software. It gives a general overview of a typical CAD flow for designing circuits that are implemented by

More information

Adder.PPT(10/1/2009) 5.1. Lecture 13. Adder Circuits

Adder.PPT(10/1/2009) 5.1. Lecture 13. Adder Circuits Adder.T(//29) 5. Lecture 3 Adder ircuits Objectives Understand how to add both signed and unsigned numbers Appreciate how the delay of an adder circuit depends on the data values that are being added together

More information

Implementation of Modified Booth Algorithm (Radix 4) and its Comparison with Booth Algorithm (Radix-2)

Implementation of Modified Booth Algorithm (Radix 4) and its Comparison with Booth Algorithm (Radix-2) Advance in Electronic and Electric Engineering. ISSN 2231-1297, Volume 3, Number 6 (2013), pp. 683-690 Research India Publications http://www.ripublication.com/aeee.htm Implementation of Modified Booth

More information

Two's Complement Adder/Subtractor Lab L03

Two's Complement Adder/Subtractor Lab L03 Two's Complement Adder/Subtractor Lab L03 Introduction Computers are usually designed to perform indirect subtraction instead of direct subtraction. Adding -B to A is equivalent to subtracting B from A,

More information

ELEC 2210 - EXPERIMENT 1 Basic Digital Logic Circuits

ELEC 2210 - EXPERIMENT 1 Basic Digital Logic Circuits Objectives ELEC - EXPERIMENT Basic Digital Logic Circuits The experiments in this laboratory exercise will provide an introduction to digital electronic circuits. You will learn how to use the IDL-00 Bit

More information

BINARY CODED DECIMAL: B.C.D.

BINARY CODED DECIMAL: B.C.D. BINARY CODED DECIMAL: B.C.D. ANOTHER METHOD TO REPRESENT DECIMAL NUMBERS USEFUL BECAUSE MANY DIGITAL DEVICES PROCESS + DISPLAY NUMBERS IN TENS IN BCD EACH NUMBER IS DEFINED BY A BINARY CODE OF 4 BITS.

More information

DB19. 4-Bit Parallel Adder/ Subtractor. Digital Lab Experiment Board Ver. 1.0

DB19. 4-Bit Parallel Adder/ Subtractor. Digital Lab Experiment Board Ver. 1.0 4-Bit Parallel Adder/ Subtractor Digital Lab Experiment Board Ver. 1.0 QUALITY POLICY To be a Global Leader of Innovative, Competitive and Eco friendly Electronic Equipment, Software Products and Turn-key

More information

Lecture 5: Gate Logic Logic Optimization

Lecture 5: Gate Logic Logic Optimization Lecture 5: Gate Logic Logic Optimization MAH, AEN EE271 Lecture 5 1 Overview Reading McCluskey, Logic Design Principles- or any text in boolean algebra Introduction We could design at the level of irsim

More information

Lab 1: Full Adder 0.0

Lab 1: Full Adder 0.0 Lab 1: Full Adder 0.0 Introduction In this lab you will design a simple digital circuit called a full adder. You will then use logic gates to draw a schematic for the circuit. Finally, you will verify

More information

16-bit ALU, Register File and Memory Write Interface

16-bit ALU, Register File and Memory Write Interface CS M152B Fall 2002 Project 2 16-bit ALU, Register File and Memory Write Interface Suggested Due Date: Monday, October 21, 2002 Actual Due Date determined by your Lab TA This project will take much longer

More information

Computer organization

Computer organization Computer organization Computer design an application of digital logic design procedures Computer = processing unit + memory system Processing unit = control + datapath Control = finite state machine inputs

More information

CSE140: Components and Design Techniques for Digital Systems

CSE140: Components and Design Techniques for Digital Systems CSE4: Components and Design Techniques for Digital Systems Tajana Simunic Rosing What we covered thus far: Number representations Logic gates Boolean algebra Introduction to CMOS HW#2 due, HW#3 assigned

More information

Digital Design with Synthesizable VHDL

Digital Design with Synthesizable VHDL Digital Design with Synthesizable VHDL Prof. Stephen A. Edwards Columbia University Spring 2012 Combinational Logic in a Dataflow Style Hierarchy: Instantiating Components (entities) Combinational Logic

More information

Combinational circuits

Combinational circuits Combinational circuits Combinational circuits are stateless The outputs are functions only of the inputs Inputs Combinational circuit Outputs 3 Thursday, September 2, 3 Enabler Circuit (High-level view)

More information

Today. Binary addition Representing negative numbers. Andrew H. Fagg: Embedded Real- Time Systems: Binary Arithmetic

Today. Binary addition Representing negative numbers. Andrew H. Fagg: Embedded Real- Time Systems: Binary Arithmetic Today Binary addition Representing negative numbers 2 Binary Addition Consider the following binary numbers: 0 0 1 0 0 1 1 0 0 0 1 0 1 0 1 1 How do we add these numbers? 3 Binary Addition 0 0 1 0 0 1 1

More information

Figure 8-1 Four Possible Results of Adding Two Bits

Figure 8-1 Four Possible Results of Adding Two Bits CHPTER EIGHT Combinational Logic pplications Thus far, our discussion has focused on the theoretical design issues of computer systems. We have not yet addressed any of the actual hardware you might find

More information

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. CHAPTER3 QUESTIONS MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. ) If one input of an AND gate is LOW while the other is a clock signal, the output

More information

An Example VHDL Application for the TM-4

An Example VHDL Application for the TM-4 An Example VHDL Application for the TM-4 Dave Galloway Edward S. Rogers Sr. Department of Electrical and Computer Engineering University of Toronto March 2005 Introduction This document describes a simple

More information

Counters and Decoders

Counters and Decoders Physics 3330 Experiment #10 Fall 1999 Purpose Counters and Decoders In this experiment, you will design and construct a 4-bit ripple-through decade counter with a decimal read-out display. Such a counter

More information

Digital Systems Design. VGA Video Display Generation

Digital Systems Design. VGA Video Display Generation Digital Systems Design Video Signal Generation for the Altera DE Board Dr. D. J. Jackson Lecture 12-1 VGA Video Display Generation A VGA signal contains 5 active signals Two TTL compatible signals for

More information

Two-level logic using NAND gates

Two-level logic using NAND gates CSE140: Components and Design Techniques for Digital Systems Two and Multilevel logic implementation Tajana Simunic Rosing 1 Two-level logic using NND gates Replace minterm ND gates with NND gates Place

More information

The string of digits 101101 in the binary number system represents the quantity

The string of digits 101101 in the binary number system represents the quantity Data Representation Section 3.1 Data Types Registers contain either data or control information Control information is a bit or group of bits used to specify the sequence of command signals needed for

More information

FORDHAM UNIVERSITY CISC 3593. Dept. of Computer and Info. Science Spring, 2011. Lab 2. The Full-Adder

FORDHAM UNIVERSITY CISC 3593. Dept. of Computer and Info. Science Spring, 2011. Lab 2. The Full-Adder FORDHAM UNIVERSITY CISC 3593 Fordham College Lincoln Center Computer Organization Dept. of Computer and Info. Science Spring, 2011 Lab 2 The Full-Adder 1 Introduction In this lab, the student will construct

More information

List of Experiment. 8. To study and verify the BCD to Seven Segments DECODER.(IC-7447).

List of Experiment. 8. To study and verify the BCD to Seven Segments DECODER.(IC-7447). G. H. RAISONI COLLEGE OF ENGINEERING, NAGPUR Department of Electronics & Communication Engineering Branch:-4 th Semester[Electronics] Subject: - Digital Circuits List of Experiment Sr. Name Of Experiment

More information

EE 261 Introduction to Logic Circuits. Module #2 Number Systems

EE 261 Introduction to Logic Circuits. Module #2 Number Systems EE 261 Introduction to Logic Circuits Module #2 Number Systems Topics A. Number System Formation B. Base Conversions C. Binary Arithmetic D. Signed Numbers E. Signed Arithmetic F. Binary Codes Textbook

More information

Computer Science 281 Binary and Hexadecimal Review

Computer Science 281 Binary and Hexadecimal Review Computer Science 281 Binary and Hexadecimal Review 1 The Binary Number System Computers store everything, both instructions and data, by using many, many transistors, each of which can be in one of two

More information

BOOLEAN ALGEBRA & LOGIC GATES

BOOLEAN ALGEBRA & LOGIC GATES BOOLEAN ALGEBRA & LOGIC GATES Logic gates are electronic circuits that can be used to implement the most elementary logic expressions, also known as Boolean expressions. The logic gate is the most basic

More information

7. Latches and Flip-Flops

7. Latches and Flip-Flops Chapter 7 Latches and Flip-Flops Page 1 of 18 7. Latches and Flip-Flops Latches and flip-flops are the basic elements for storing information. One latch or flip-flop can store one bit of information. The

More information

Lecture #21 April 2, 2004 Relays and Adder/Subtractors

Lecture #21 April 2, 2004 Relays and Adder/Subtractors Lecture #21 April 2, 2004 Relays and Adder/Subtractors In this lecture we look at a real technology for implementing gate circuits, as well as a more-or-less complete design for a general purpose adder/subtractor

More information

Building Blocks for Digital Design

Building Blocks for Digital Design Building Blocks for Digital Design The construction of most digital systems is a large task. Disciplined designers in any field will subdivide the original task into manageable subunits building blocks

More information

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design PH-315 COMINATIONAL and SEUENTIAL LOGIC CIRCUITS Hardware implementation and software design A La Rosa I PURPOSE: To familiarize with combinational and sequential logic circuits Combinational circuits

More information

MICROPROCESSOR AND MICROCOMPUTER BASICS

MICROPROCESSOR AND MICROCOMPUTER BASICS Introduction MICROPROCESSOR AND MICROCOMPUTER BASICS At present there are many types and sizes of computers available. These computers are designed and constructed based on digital and Integrated Circuit

More information

MEP Y9 Practice Book A

MEP Y9 Practice Book A 1 Base Arithmetic 1.1 Binary Numbers We normally work with numbers in base 10. In this section we consider numbers in base 2, often called binary numbers. In base 10 we use the digits 0, 1, 2, 3, 4, 5,

More information

Levent EREN levent.eren@ieu.edu.tr A-306 Office Phone:488-9882 INTRODUCTION TO DIGITAL LOGIC

Levent EREN levent.eren@ieu.edu.tr A-306 Office Phone:488-9882 INTRODUCTION TO DIGITAL LOGIC Levent EREN levent.eren@ieu.edu.tr A-306 Office Phone:488-9882 1 Number Systems Representation Positive radix, positional number systems A number with radix r is represented by a string of digits: A n

More information

RUTGERS UNIVERSITY Department of Electrical and Computer Engineering 14:332:233 DIGITAL LOGIC DESIGN LABORATORY

RUTGERS UNIVERSITY Department of Electrical and Computer Engineering 14:332:233 DIGITAL LOGIC DESIGN LABORATORY RUTGERS UNIVERSITY Department of Electrical and Computer Engineering 14:332:233 DIGITAL LOGIC DESIGN LABORATORY Fall 2012 Contents 1 LABORATORY No 1 3 11 Equipment 3 12 Protoboard 4 13 The Input-Control/Output-Display

More information

Hardware Implementation of the Stone Metamorphic Cipher

Hardware Implementation of the Stone Metamorphic Cipher International Journal of Computer Science & Network Security VOL.10 No.8, 2010 Hardware Implementation of the Stone Metamorphic Cipher Rabie A. Mahmoud 1, Magdy Saeb 2 1. Department of Mathematics, Faculty

More information

Step : Create Dependency Graph for Data Path Step b: 8-way Addition? So, the data operations are: 8 multiplications one 8-way addition Balanced binary

Step : Create Dependency Graph for Data Path Step b: 8-way Addition? So, the data operations are: 8 multiplications one 8-way addition Balanced binary RTL Design RTL Overview Gate-level design is now rare! design automation is necessary to manage the complexity of modern circuits only library designers use gates automated RTL synthesis is now almost

More information

Register File, Finite State Machines & Hardware Control Language

Register File, Finite State Machines & Hardware Control Language Register File, Finite State Machines & Hardware Control Language Avin R. Lebeck Some slides based on those developed by Gershon Kedem, and by Randy Bryant and ave O Hallaron Compsci 04 Administrivia Homework

More information

ECE232: Hardware Organization and Design. Part 3: Verilog Tutorial. http://www.ecs.umass.edu/ece/ece232/ Basic Verilog

ECE232: Hardware Organization and Design. Part 3: Verilog Tutorial. http://www.ecs.umass.edu/ece/ece232/ Basic Verilog ECE232: Hardware Organization and Design Part 3: Verilog Tutorial http://www.ecs.umass.edu/ece/ece232/ Basic Verilog module ();

More information

Multiplexers Two Types + Verilog

Multiplexers Two Types + Verilog Multiplexers Two Types + Verilog ENEE 245: Digital Circuits and ystems Laboratory Lab 7 Objectives The objectives of this laboratory are the following: To become familiar with continuous ments and procedural

More information

Basic Logic Gates Richard E. Haskell

Basic Logic Gates Richard E. Haskell BASIC LOGIC GATES 1 E Basic Logic Gates Richard E. Haskell All digital systems are made from a few basic digital circuits that we call logic gates. These circuits perform the basic logic functions that

More information

Circuits and Boolean Expressions

Circuits and Boolean Expressions Circuits and Boolean Expressions Provided by TryEngineering - Lesson Focus Boolean logic is essential to understanding computer architecture. It is also useful in program construction and Artificial Intelligence.

More information

(Refer Slide Time: 00:01:16 min)

(Refer Slide Time: 00:01:16 min) Digital Computer Organization Prof. P. K. Biswas Department of Electronic & Electrical Communication Engineering Indian Institute of Technology, Kharagpur Lecture No. # 04 CPU Design: Tirning & Control

More information

An Effective Deterministic BIST Scheme for Shifter/Accumulator Pairs in Datapaths

An Effective Deterministic BIST Scheme for Shifter/Accumulator Pairs in Datapaths An Effective Deterministic BIST Scheme for Shifter/Accumulator Pairs in Datapaths N. KRANITIS M. PSARAKIS D. GIZOPOULOS 2 A. PASCHALIS 3 Y. ZORIAN 4 Institute of Informatics & Telecommunications, NCSR

More information

Lecture 8: Binary Multiplication & Division

Lecture 8: Binary Multiplication & Division Lecture 8: Binary Multiplication & Division Today s topics: Addition/Subtraction Multiplication Division Reminder: get started early on assignment 3 1 2 s Complement Signed Numbers two = 0 ten 0001 two

More information

MICROPROCESSOR. Exclusive for IACE Students www.iace.co.in iacehyd.blogspot.in Ph: 9700077455/422 Page 1

MICROPROCESSOR. Exclusive for IACE Students www.iace.co.in iacehyd.blogspot.in Ph: 9700077455/422 Page 1 MICROPROCESSOR A microprocessor incorporates the functions of a computer s central processing unit (CPU) on a single Integrated (IC), or at most a few integrated circuit. It is a multipurpose, programmable

More information

CNC FOR EDM MACHINE TOOL HARDWARE STRUCTURE. Ioan Lemeni

CNC FOR EDM MACHINE TOOL HARDWARE STRUCTURE. Ioan Lemeni CNC FOR EDM MACHINE TOOL HARDWARE STRUCTURE Ioan Lemeni Computer and Communication Engineering Department Faculty of Automation, Computers and Electronics University of Craiova 13, A.I. Cuza, Craiova,

More information

Design of Low Power One-Bit Hybrid-CMOS Full Adder Cells

Design of Low Power One-Bit Hybrid-CMOS Full Adder Cells Design of Low Power One-Bit Hybrid-CMOS Full Adder Cells Sushil B. Bhaisare 1, Sonalee P. Suryawanshi 2, Sagar P. Soitkar 3 1 Lecturer in Electronics Department, Nagpur University, G.H.R.I.E.T.W. Nagpur,

More information

Karnaugh Maps. Circuit-wise, this leads to a minimal two-level implementation

Karnaugh Maps. Circuit-wise, this leads to a minimal two-level implementation Karnaugh Maps Applications of Boolean logic to circuit design The basic Boolean operations are AND, OR and NOT These operations can be combined to form complex expressions, which can also be directly translated

More information

ASYNCHRONOUS COUNTERS

ASYNCHRONOUS COUNTERS LB no.. SYNCHONOUS COUNTES. Introduction Counters are sequential logic circuits that counts the pulses applied at their clock input. They usually have 4 bits, delivering at the outputs the corresponding

More information

Binary Division. Decimal Division. Hardware for Binary Division. Simple 16-bit Divider Circuit

Binary Division. Decimal Division. Hardware for Binary Division. Simple 16-bit Divider Circuit Decimal Division Remember 4th grade long division? 43 // quotient 12 521 // divisor dividend -480 41-36 5 // remainder Shift divisor left (multiply by 10) until MSB lines up with dividend s Repeat until

More information

1. Convert the following base 10 numbers into 8-bit 2 s complement notation 0, -1, -12

1. Convert the following base 10 numbers into 8-bit 2 s complement notation 0, -1, -12 C5 Solutions 1. Convert the following base 10 numbers into 8-bit 2 s complement notation 0, -1, -12 To Compute 0 0 = 00000000 To Compute 1 Step 1. Convert 1 to binary 00000001 Step 2. Flip the bits 11111110

More information

Designing Digital Circuits a modern approach. Jonathan Turner

Designing Digital Circuits a modern approach. Jonathan Turner Designing Digital Circuits a modern approach Jonathan Turner 2 Contents I First Half 5 1 Introduction to Designing Digital Circuits 7 1.1 Getting Started.......................... 7 1.2 Gates and Flip

More information

CS101 Lecture 26: Low Level Programming. John Magee 30 July 2013 Some material copyright Jones and Bartlett. Overview/Questions

CS101 Lecture 26: Low Level Programming. John Magee 30 July 2013 Some material copyright Jones and Bartlett. Overview/Questions CS101 Lecture 26: Low Level Programming John Magee 30 July 2013 Some material copyright Jones and Bartlett 1 Overview/Questions What did we do last time? How can we control the computer s circuits? How

More information

Read-only memory Implementing logic with ROM Programmable logic devices Implementing logic with PLDs Static hazards

Read-only memory Implementing logic with ROM Programmable logic devices Implementing logic with PLDs Static hazards Points ddressed in this Lecture Lecture 8: ROM Programmable Logic Devices Professor Peter Cheung Department of EEE, Imperial College London Read-only memory Implementing logic with ROM Programmable logic

More information

Layout of Multiple Cells

Layout of Multiple Cells Layout of Multiple Cells Beyond the primitive tier primitives add instances of primitives add additional transistors if necessary add substrate/well contacts (plugs) add additional polygons where needed

More information

The 104 Duke_ACC Machine

The 104 Duke_ACC Machine The 104 Duke_ACC Machine The goal of the next two lessons is to design and simulate a simple accumulator-based processor. The specifications for this processor and some of the QuartusII design components

More information

VHDL programmering H2

VHDL programmering H2 VHDL programmering H2 VHDL (Very high speed Integrated circuits) Hardware Description Language IEEE standard 1076-1993 Den benytter vi!! Hvornår blev den frigivet som standard første gang?? Ca. 1980!!

More information

LFSR BASED COUNTERS AVINASH AJANE, B.E. A technical report submitted to the Graduate School. in partial fulfillment of the requirements

LFSR BASED COUNTERS AVINASH AJANE, B.E. A technical report submitted to the Graduate School. in partial fulfillment of the requirements LFSR BASED COUNTERS BY AVINASH AJANE, B.E A technical report submitted to the Graduate School in partial fulfillment of the requirements for the degree Master of Science in Electrical Engineering New Mexico

More information

Logic in Computer Science: Logic Gates

Logic in Computer Science: Logic Gates Logic in Computer Science: Logic Gates Lila Kari The University of Western Ontario Logic in Computer Science: Logic Gates CS2209, Applied Logic for Computer Science 1 / 49 Logic and bit operations Computers

More information

EE360: Digital Design I Course Syllabus

EE360: Digital Design I Course Syllabus : Course Syllabus Dr. Mohammad H. Awedh Fall 2008 Course Description This course introduces students to the basic concepts of digital systems, including analysis and design. Both combinational and sequential

More information

To convert an arbitrary power of 2 into its English equivalent, remember the rules of exponential arithmetic:

To convert an arbitrary power of 2 into its English equivalent, remember the rules of exponential arithmetic: Binary Numbers In computer science we deal almost exclusively with binary numbers. it will be very helpful to memorize some binary constants and their decimal and English equivalents. By English equivalents

More information

SELECT INPUTS STROBE OUTPUTS

SELECT INPUTS STROBE OUTPUTS 1 9. 1. I SN74153. 4x1 U1 74153 2 21 22 23 1. SN74153 ( ), ogic Is-MUs MUX. SEET DT INPUTS STROE OUTPUT INPUTS 1 2 3 G Y 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 X X 1. SN74153. : SEET INPUTS

More information

State Machines in VHDL

State Machines in VHDL State Machines in VHDL Implementing state machines in VHDL is fun and easy provided you stick to some fairly well established forms. These styles for state machine coding given here is not intended to

More information