Combinational-Circuit Building Blocks

Size: px
Start display at page:

Download "Combinational-Circuit Building Blocks"

Transcription

1 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 Multiplexers, which can be used or selection o signals and or implementation o general logic unctions Circuits used or encoding, decoding, and code-conversion purposes Key VHDL constructs used to deine combinational circuits 35

2 May 9, 24 :4 vra6857_ch6 Sheet number 2 Page number 36 black 36 CHAPTER 6 Combinational-Circuit Building Blocks Previous chapters have introduced the basic techniques or design o logic circuits. In practice, a ew types o logic circuits are oten used as building blocks in larger designs. This chapter discusses a number o these blocks and gives examples o their use. The chapter also includes a major section on VHDL, which describes several key eatures o the language. 6. Multiplexers Multiplexers were introduced briely in Chapters 2 and 3. A multiplexer circuit has a number o data inputs, one or more select inputs, and one output. It passes the signal value on one o the data inputs to the output. The data input is selected by the values o the select inputs. Figure 6. shows a 2-to- multiplexer. Part (a) gives the symbol commonly used. The select input, s, chooses as the output o the multiplexer either input w or w. The multiplexer s unctionality can be described in the orm o a truth table as shown in part (b) o the igure. Part (c) gives a sum-o-products implementation o the 2-to- multiplexer, and part (d) illustrates how it can be constructed with transmission gates. Figure 6.2a depicts a larger multiplexer with our data inputs, w,...,, and two select inputs, s and s. As shown in the truth table in part (b) o the igure, the two-bit number represented by s s selects one o the data inputs as the output o the multiplexer. s s w w w w (a) Graphical symbol (b) Truth table w w s s w w (c) Sum-o-products circuit (d) Circuit with transmission gates Figure 6. A 2-to- multiplexer.

3 May 9, 24 :4 vra6857_ch6 Sheet number 3 Page number 37 black 6. Multiplexers 37 s s s s w w w w (a) Graphical symbol (b) Truth table s s w w (c) Circuit Figure 6.2 A 4-to- multiplexer. A sum-o-products implementation o the 4-to- multiplexer appears in Figure 6.2c. It realizes the multiplexer unction = s s w + s s w + s s + s s It is possible to build larger multiplexers using the same approach. Usually, the number o data inputs, n, is an integer power o two. A multiplexer that has n data inputs, w,...,w n, requires log 2 n select inputs. Larger multiplexers can also be constructed rom smaller multiplexers. For example, the 4-to- multiplexer can be built using three 2-to- multiplexers as illustrated in Figure 6.3. I the 4-to- multiplexer is implemented using transmission gates, then the structure in this igure is always used. Figure 6.4 shows how a 6-to- multiplexer is constructed with ive 4-to- multiplexers.

4 May 9, 24 :4 vra6857_ch6 Sheet number 4 Page number 38 black 38 CHAPTER 6 Combinational-Circuit Building Blocks s s w w Figure 6.3 Using 2-to- multiplexers to build a 4-to- multiplexer. s s w w 4 s 2 s 3 w 7 w 8 w w 5 Figure 6.4 A 6-to- multiplexer.

5 May 9, 24 :4 vra6857_ch6 Sheet number 5 Page number 39 black 6. Multiplexers 39 Figure 6.5 shows a circuit that has two inputs, x and x 2, and two outputs, y and y 2.As indicated by the blue lines, the unction o the circuit is to allow either o its inputs to be connected to either o its outputs, under the control o another input, s. A circuit that has n inputs and k outputs, whose sole unction is to provide a capability to connect any input to any output, is usually reerred to as an n k crossbar switch. Crossbars o various sizes can be created, with dierent numbers o inputs and outputs. When there are two inputs and two outputs, it is called a 2 2 crossbar. Figure 6.5b shows how the 2 2 crossbar can be implemented using 2-to- multiplexers. The multiplexer select inputs are controlled by the signal s. I s =, the crossbar connects x to y and x 2 to y 2, while i s =, the crossbar connects x to y 2 and x 2 to y. Crossbar switches are useul in many practical applications in which it is necessary to be able to connect one set o wires to another set o wires, where the connection pattern changes rom time to time. Example 6. We introduced ield-programmable gate array (FPGA) chips in section Figure 3.39 depicts a small FPGA that is programmed to implement a particular circuit. The logic blocks in the FPGA have two inputs, and there are our tracks in each routing channel. Each o the programmable switches that connects a logic block input or output to an interconnection wire is shown as an X. A small part o Figure 3.39 is reproduced in Figure 6.6a. For clarity, Example 6.2 s x y x 2 y 2 (a) A 2x2 crossbar switch x y s x 2 y 2 (b) Implementation using multiplexers Figure 6.5 A practical application o multiplexers.

6 May 9, 24 :4 vra6857_ch6 Sheet number 6 Page number 32 black 32 CHAPTER 6 Combinational-Circuit Building Blocks i i 2 (a) Part o the FPGA in Figure 3.39 / / / / i i 2 Storage cell / / / / (b) Implementation using pass transistors / / i i 2 / / (c) Implementation using multiplexers Figure 6.6 Implementing programmable switches in an FPGA.

7 May 9, 24 :4 vra6857_ch6 Sheet number 7 Page number 32 black 6. Multiplexers 32 the igure shows only a single logic block and the interconnection wires and switches associated with its input terminals. One way in which the programmable switches can be implemented is illustrated in Figure 6.6b. Each X in part (a) o the igure is realized using an NMOS transistor controlled by a storage cell. This type o programmable switch was also shown in Figure We described storage cells briely in section and will discuss them in more detail in section.. Each cell stores a single logic value, either or, and provides this value as the output o the cell. Each storage cell is built by using several transistors. Thus the eight cells shown in the igure use a signiicant amount o chip area. The number o storage cells needed can be reduced by using multiplexers, as shown in Figure 6.6c. Each logic block input is ed by a 4-to- multiplexer, with the select inputs controlled by storage cells. This approach requires only our storage cells, instead o eight. In commercial FPGAs the multiplexer-based approach is usually adopted. 6.. Synthesis o Logic Functions Using Multiplexers Multiplexers are useul in many practical applications, such as those described above. They can also be used in a more general way to synthesize logic unctions. Consider the example in Figure 6.7a. The truth table deines the unction = w. This unction can be implemented by a 4-to- multiplexer in which the values o in each row o the truth table are connected as constants to the multiplexer data inputs. The multiplexer select inputs are driven by w and. Thus or each valuation o w, the output is equal to the unction value in the corresponding row o the truth table. The above implementation is straightorward, but it is not very eicient. A better implementation can be derived by manipulating the truth table as indicated in Figure 6.7b, which allows to be implemented by a single 2-to- multiplexer. One o the input signals, w in this example, is chosen as the select input o the 2-to- multiplexer. The truth table is redrawn to indicate the value o or each value o w. When w =, has the same value as input, and when w =, has the value o. The circuit that implements this truth table is given in Figure 6.7c. This procedure can be applied to synthesize a circuit that implements any logic unction. Figure 6.8a gives the truth table or the three-input majority unction, and it shows how the truth table can be modiied to implement the unction using a 4-to- multiplexer. Any two o the three inputs may be chosen as the multiplexer select inputs. We have chosen w and or this purpose, resulting in the circuit in Figure 6.8b. Example 6.3

8 May 9, 24 :4 vra6857_ch6 Sheet number 8 Page number 322 black 322 CHAPTER 6 Combinational-Circuit Building Blocks w w (a) Implementation using a 4-to- multiplexer w w w2 (b) Modiied truth table w (c) Circuit Figure 6.7 Synthesis o a logic unction using mutiplexers. Example 6.4 Figure 6.9a indicates how the unction = w can be implemented using 2-to- multiplexers. When w =, is equal to the XOR o and, and when w =, is the XNOR o and. The let multiplexer in the circuit produces, using the result rom Figure 6.7, and the right multiplexer uses the value o w to select either or its complement. Note that we could have derived this circuit directly by writing the unction as = ( ) w. Figure 6. gives an implementation o the three-input XOR unction using a 4-to- multiplexer. Choosing w and or the select inputs results in the circuit shown.

9 May 9, 24 :4 vra6857_ch6 Sheet number 9 Page number 323 black 6. Multiplexers 323 w w (a) Modiied truth table w (b) Circuit Figure 6.8 Implementation o the three-input majority unction using a 4-to- multiplexer. w w (a) Truth table (b) Circuit Figure 6.9 Three-input XOR implemented with 2-to- multiplexers.

10 May 9, 24 :4 vra6857_ch6 Sheet number Page number 324 black 324 CHAPTER 6 Combinational-Circuit Building Blocks w w (a) Truth table (b) Circuit Figure 6. Three-input XOR implemented with a 4-to- multiplexer Multiplexer Synthesis Using Shannon s Expansion Figures 6.8 through 6. illustrate how truth tables can be interpreted to implement logic unctions using multiplexers. In each case the inputs to the multiplexers are the constants and, or some variable or its complement. Besides using such simple inputs, it is possible to connect more complex circuits as inputs to a multiplexer, allowing unctions to be synthesized using a combination o multiplexers and other logic gates. Suppose that we want to implement the three-input majority unction in Figure 6.8 using a 2-to- multiplexer in this way. Figure 6. shows an intuitive way o realizing this unction. The truth table can be modiied as shown on the right. I w =, then =, and i w =, then = +. Using w as the select input or a 2-to- multiplexer leads to the circuit in Figure 6.b. This implementation can be derived using algebraic manipulation as ollows. The unction in Figure 6.a is expressed in sum-o-products orm as = w + w + w + w It can be manipulated into = w ( ) + w ( + + ) = w ( ) + w ( + ) which corresponds to the circuit in Figure 6.b. Multiplexer implementations o logic unctions require that a given unction be decomposed in terms o the variables that are used as the select inputs. This can be accomplished by means o a theorem proposed by Claude Shannon [].

11 May 9, 24 :4 vra6857_ch6 Sheet number Page number 325 black 6. Multiplexers 325 w w w2 w3 + (a) Truth table w2 w (b) Circuit Figure 6. The three-input majority unction implemented using a 2-to- multiplexer. Shannon s Expansion Theorem Any Boolean unction (w,...,w n ) can be written in the orm (w,,...,w n ) = w (,,...,w n ) + w (,,...,w n ) This expansion can be done in terms o any o the n variables. We will leave the proo o the theorem as an exercise or the reader (see problem 6.9). To illustrate its use, we can apply the theorem to the three-input majority unction, which can be written as (w,, ) = w + w + Expanding this unction in terms o w gives = w ( ) + w ( + ) which is the expression that we derived above.

12 May 9, 24 :4 vra6857_ch6 Sheet number 2 Page number 326 black 326 CHAPTER 6 Combinational-Circuit Building Blocks For the three-input XOR unction, we have = w = w ( ) + w ( ) which gives the circuit in Figure 6.9b. In Shannon s expansion the term (,,...,w n ) is called the coactor o with respect to w ; it is denoted in shorthand notation as w. Similarly, the term (,,...,w n ) is called the coactor o with respect to w, written w. Hence we can write = w w + w w In general, i the expansion is done with respect to variable w i, then wi (w,...,w i,, w i+,...,w n ) and denotes (w,...,w n ) = w i wi + w i wi The complexity o the logic expression may vary, depending on which variable, w i, is used, as illustrated in Example 6.5. Example 6.5 For the unction = w +, decomposition using w gives Using instead o w produces Finally, using gives = w w + w w = w ( + ) + w ( ) = w2 + w2 = (w ) + (w + ) = w3 + w3 = ( ) + (w ) The results generated using w and have the same cost, but the expression produced using has a lower cost. In practice, the CAD tools that perorm decompositions o this type try a number o alternatives and choose the one that produces the best result. Shannon s expansion can be done in terms o more than one variable. For example, expanding a unction in terms o w and gives (w,...,w n ) = w (,,,...,w n ) + w (,,,...,w n ) + w (,,,, w n ) + w (,,,...,w n ) This expansion gives a orm that can be implemented using a 4-to- multiplexer. I Shannon s expansion is done in terms o all n variables, then the result is the canonical sum-oproducts orm, which was deined in section 2.6..

13 May 9, 24 :4 vra6857_ch6 Sheet number 3 Page number 327 black 6. Multiplexers 327 w (a) Using a 2-to- multiplexer w (b) Using a 4-to- multiplexer Figure 6.2 The circuits synthesized in Example 6.6. Assume that we wish to implement the unction Example 6.6 = w + w + w using a 2-to- multiplexer and any other necessary gates. Shannon s expansion using w gives = w w + w w = w ( ) + w ( + ) The corresponding circuit is shown in Figure 6.2a. Assume now that we wish to use a 4-to- multiplexer instead. Further decomposition using gives = w w + w w + w w + w w = w ( ) + w ( ) + w ( ) + w () The circuit is shown in Figure 6.2b. Consider the three-input majority unction Example 6.7 = w + w +

14 May 9, 24 :4 vra6857_ch6 Sheet number 4 Page number 328 black 328 CHAPTER 6 Combinational-Circuit Building Blocks w Figure 6.3 The circuit synthesized in Example 6.7. We wish to implement this unction using only 2-to- multiplexers. Shannon s expansion using w yields = w ( ) + w ( + + ) = w ( ) + w ( + ) Let g = and h = +. Expansion o both g and h using gives g = () + ( ) h = ( ) + () The corresponding circuit is shown in Figure 6.3. It is equivalent to the 4-to- multiplexer circuit derived using a truth table in Figure 6.8. Example 6.8 In section we said that most FPGAs use lookup tables or their logic blocks. Assume that an FPGA exists in which each logic block is a three-input lookup table (3-LUT). Because it stores a truth table, a 3-LUT can realize any logic unction o three variables. Using Shannon s expansion, any our-variable unction can be realized with at most three 3-LUTs. Consider the unction Expansion in terms o w produces = w w + w w = + w + w 4 + w w 4 = w ( + + w 4 ) + w ( + w 4 + w 4 ) = w ( + ) + w ( + w 4 + w 4 ) A circuit with three 3-LUTs that implements this expression is shown in Figure 6.4a. Decomposition o the unction using, instead o w, gives = w2 + w2 = ( + w w 4 ) + (w + w 4 )

15 May 9, 24 :4 vra6857_ch6 Sheet number 5 Page number 329 black 6.2 Decoders 329 w w w w 4 (a) Using three 3-LUTs w w 4 w2 (b) Using two 3-LUTs Figure 6.4 Circuits synthesized in Example 6.8. Observe that w2 = w2 ; hence only two 3-LUTs are needed, as illustrated in Figure 6.4b. The LUT on the right implements the two-variable unction w2 + w2. Since it is possible to implement any logic unction using multiplexers, general-purpose chips exist that contain multiplexers as their basic logic resources. Both Actel Corporation [2] and QuickLogic Corporation [3] oer FPGAs in which the logic block comprises an arrangement o multiplexers. Texas Instruments oers gate array chips that have multiplexerbased logic blocks [4]. 6.2 Decoders Decoder circuits are used to decode encoded inormation. A binary decoder, depicted in Figure 6.5, is a logic circuit with n inputs and 2 n outputs. Only one output is asserted at a time, and each output corresponds to one valuation o the inputs. The decoder also has an enable input, En, that is used to disable the outputs; i En =, then none o the decoder outputs is asserted. I En =, the valuation o w n w w determines which o the outputs is asserted. An n-bit binary code in which exactly one o the bits is set to at a

16 May 9, 24 :4 vra6857_ch6 Sheet number 6 Page number 33 black 33 CHAPTER 6 Combinational-Circuit Building Blocks w y n inputs w n 2 n outputs Enable En y 2 n Figure 6.5 An n-to-2 n binary decoder. time is reerred to as one-hot encoded, meaning that the single bit that is set to is deemed to be hot. The outputs o a binary decoder are one-hot encoded. A 2-to-4 decoder is given in Figure 6.6. The two data inputs are w and w. They represent a two-bit number that causes the decoder to assert one o the outputs y,...,y 3. Although a decoder can be designed to have either active-high or active-low outputs, in En w w y y y 2 y 3 x x w y w y y 2 En y 3 (a) Truth table (b) Graphical symbol w y w y y 2 y 3 En (c) Logic circuit Figure 6.6 A 2-to-4 decoder.

17 May 9, 24 :4 vra6857_ch6 Sheet number 7 Page number 33 black 6.2 Decoders 33 w w y y w w y y y 2 y 2 En y 3 y 3 En w y y 4 w y y 5 En y 2 y 3 y 6 y 7 Figure 6.7 A 3-to-8 decoder using two 2-to-4 decoders. Figure 6.6 active-high outputs are assumed. Setting the inputs w w to,,, or causes the output y, y, y 2,ory 3 to be set to, respectively. A graphical symbol or the decoder is given in part (b) o the igure, and a logic circuit is shown in part (c). Larger decoders can be built using the sum-o-products structure in Figure 6.6c, or else they can be constructed rom smaller decoders. Figure 6.7 shows how a 3-to-8 decoder is built with two 2-to-4 decoders. The input drives the enable inputs o the two decoders. The top decoder is enabled i =, and the bottom decoder is enabled i =. This concept can be applied or decoders o any size. Figure 6.8 shows how ive 2-to-4 decoders can be used to construct a 4-to-6 decoder. Because o its treelike structure, this type o circuit is oten reerred to as a decoder tree. Decoders are useul or many practical purposes. In Figure 6.2c we showed the sum-oproducts implementation o the 4-to- multiplexer, which requires AND gates to distinguish the our dierent valuations o the select inputs s and s. Since a decoder evaluates the values on its inputs, it can be used to build a multiplexer as illustrated in Figure 6.9. The enable input o the decoder is not needed in this case, and it is set to. The our outputs o the decoder represent the our valuations o the select inputs. Example 6.9 In Figure 3.59 we showed how a 2-to- multiplexer can be constructed using two tri-state buers. This concept can be applied to any size o multiplexer, with the addition o a decoder. An example is shown in Figure 6.2. The decoder enables one o the tri-state buers or each valuation o the select lines, and that tri-state buer drives the output,, with the selected data input. We have now seen that multiplexers can be implemented in various ways. The choice o whether to employ the sum-o-products orm, transmission gates, or tri-state buers depends on the resources available in the chip being used. For instance, most FPGAs that use lookup tables or their logic blocks do not contain tri-state Example 6.

18 May 9, 24 :4 vra6857_ch6 Sheet number 8 Page number 332 black 332 CHAPTER 6 Combinational-Circuit Building Blocks w w y y w w y y En y 2 y 3 y 2 y 3 w y y 4 w y y 5 y 2 y 6 w y En y 3 y 7 w y y 2 En En y 3 w y y 8 w y y 9 En y 2 y 3 y y w y y 2 w y y 3 En y 2 y 3 y 4 y 5 Figure 6.8 A 4-to-6 decoder built using a decoder tree. w w s s w y w y y 2 En y 3 Figure 6.9 A 4-to- multiplexer built using a decoder.

19 May 9, 24 :4 vra6857_ch6 Sheet number 9 Page number 333 black 6.2 Decoders 333 w s w y w s w y y 2 En y 3 Figure 6.2 A 4-to- multiplexer built using a decoder and tri-state buers. buers. Hence multiplexers must be implemented in the sum-o-products orm using the lookup tables (see Example 6.3) Demultiplexers We showed in section 6. that a multiplexer has one output, n data inputs, and log 2 n select inputs. The purpose o the multiplexer circuit is to multiplex the n data inputs onto the single data output under control o the select inputs. A circuit that perorms the opposite unction, namely, placing the value o a single data input onto multiple data outputs, is called a demultiplexer. The demultiplexer can be implemented using a decoder circuit. For example, the 2-to-4 decoder in Figure 6.6 can be used as a -to-4 demultiplexer. In this case the En input serves as the data input or the demultiplexer, and the y to y 3 outputs are the data outputs. The valuation o w w determines which o the outputs is set to the value o En. To see how the circuit works, consider the truth table in Figure 6.6a. When En =, all the outputs are set to, including the one selected by the valuation o w w. When En =, the valuation o w w sets the appropriate output to. In general, an n-to-2 n decoder circuit can be used as a -to-n demultiplexer. However, in practice decoder circuits are used much more oten as decoders rather than as demultiplexers. In many applications the decoder s En input is not actually needed; hence it can be omitted. In this case the decoder always asserts one o its data outputs, y,...,y 2 n, according to the valuation o the data inputs, w n w. Example 6. uses a decoder that does not have the En input.

20 May 9, 24 :4 vra6857_ch6 Sheet number 2 Page number 334 black 334 CHAPTER 6 Combinational-Circuit Building Blocks Example 6. One o the most important applications o decoders is in memory blocks, which are used to store inormation. Such memory blocks are included in digital systems, such as computers, where there is a need to store large amounts o inormation electronically. One type o memory block is called a read-only memory (ROM). A ROM consists o a collection o storage cells, where each cell permanently stores a single logic value, either or. Figure 6.2 shows an example o a ROM block. The storage cells are arranged in 2 m rows with n cells per row. Thus each row stores n bits o inormation. The location o each row in the ROM is identiied by its address. In the igure the row at the top o the ROM has address, and the row at the bottom has address 2 m. The inormation stored in the rows can be accessed by asserting the select lines, Sel to Sel 2 m. As shown in the igure, a decoder with m inputs and 2 m outputs is used to generate the signals on the select lines. Since the inputs to the decoder choose the particular address (row) selected, they are called the address lines. The inormation stored in the row appears on the data outputs o the ROM, d n,...,d, which are called the data lines. Figure 6.2 shows that each data line has an associated tri-state buer that is enabled by the ROM input named Read. To access, or read, data rom the ROM, the address o the desired row is placed on the address lines and Read is set to. Sel / / / Sel / / / Address a a a m m-to-2 m decoder Sel 2 / / / Sel m 2 / / / Read Data d n d n 2 d Figure 6.2 A 2 m n read-only memory (ROM) block.

21 May 9, 24 :4 vra6857_ch6 Sheet number 2 Page number 335 black 6.3 Encoders 335 Many dierent types o memory blocks exist. In a ROM the stored inormation can be read out o the storage cells, but it cannot be changed (see problem 6.32). Another type o ROM allows inormation to be both read out o the storage cells and stored, or written, into them. Reading its contents is the normal operation, whereas writing requires a special procedure. Such a memory block is called a programmable ROM (PROM). The storage cells in a PROM are usually implemented using EEPROM transistors. We discussed EEPROM transistors in section 3. to show how they are used in PLDs. Other types o memory blocks are discussed in section Encoders An encoder perorms the opposite unction o a decoder. It encodes given inormation into a more compact orm Binary Encoders A binary encoder encodes inormation rom 2 n inputs into an n-bit code, as indicated in Figure Exactly one o the input signals should have a value o, and the outputs present the binary number that identiies which input is equal to. The truth table or a 4-to-2 encoder is provided in Figure 6.23a. Observe that the output y is when either input w or is, and output y is when input or is. Hence these outputs can be generated by the circuit in Figure 6.23b. Note that we assume that the inputs are one-hot encoded. All input patterns that have multiple inputs set to are not shown in the truth table, and they are treated as don t-care conditions. Encoders are used to reduce the number o bits needed to represent given inormation. A practical use o encoders is or transmitting inormation in a digital system. Encoding the inormation allows the transmission link to be built using ewer wires. Encoding is also useul i inormation is to be stored or later use because ewer bits need to be stored. w 2 n inputs n y y n n outputs Figure 6.22 A 2 n -to-n binary encoder.

22 May 9, 24 :4 vra6857_ch6 Sheet number 22 Page number 336 black 336 CHAPTER 6 Combinational-Circuit Building Blocks w w y y (a) Truth table w w y y (b) Circuit Figure 6.23 A 4-to-2 binary encoder Priority Encoders Another useul class o encoders is based on the priority o input signals. In a priority encoder each input has a priority level associated with it. The encoder outputs indicate the active input that has the highest priority. When an input with a high priority is asserted, the other inputs with lower priority are ignored. The truth table or a 4-to-2 priority encoder is shown in Figure It assumes that w has the lowest priority and the highest. The outputs y and y represent the binary number that identiies the highest priority input set to. Since it is possible that none o the inputs is equal to, an output, z, is provided to indicate this condition. It is set to when at least one o the inputs is equal to. It is set to w w y y z x x x x x x d d Figure 6.24 Truth table or a 4-to-2 priority encoder.

23 May 9, 24 :4 vra6857_ch6 Sheet number 23 Page number 337 black 6.4 Code Converters 337 when all inputs are equal to. The outputs y and y are not meaningul in this case, and hence the irst row o the truth table can be treated as a don t-care condition or y and y. The behavior o the priority encoder is most easily understood by irst considering the last row in the truth table. It speciies that i input is, then the outputs are set to y y =. Because has the highest priority level, the values o inputs, w, and w do not matter. To relect the act that their values are irrelevant,, w, and w are denoted by the symbol x in the truth table. The second-last row in the truth table stipulates that i =, then the outputs are set to y y =, but only i =. Similarly, input w causes the outputs to be set to y y = only i both and are. Input w produces the outputs y y = only i w is the only input that is asserted. Alogic circuit that implements the truth table can be synthesized by using the techniques developed in Chapter 4. However, a more convenient way to derive the circuit is to deine a set o intermediate signals, i,...,i 3, based on the observations above. Each signal, i k, is equal to only i the input with the same index, w k, represents the highest-priority input that is set to. The logic expressions or i,...,i 3 are i = w w i = w i 2 = i 3 = Using the intermediate signals, the rest o the circuit or the priority encoder has the same structure as the binary encoder in Figure 6.23, namely The output z is given by y = i + i 3 y = i 2 + i 3 z = i + i + i 2 + i Code Converters The purpose o the decoder and encoder circuits is to convert rom one type o input encoding to a dierent output encoding. For example, a 3-to-8 binary decoder converts rom a binary number on the input to a one-hot encoding at the output. An 8-to-3 binary encoder perorms the opposite conversion. There are many other possible types o code converters. One common example is a BCD-to-7-segment decoder, which converts one binary-coded decimal (BCD) digit into inormation suitable or driving a digit-oriented display. As illustrated in Figure 6.25a, the circuit converts the BCD digit into seven signals that are used to drive the segments in the display. Each segment is a small light-emitting diode (LED), which glows when driven by an electrical signal. The segments are labeled rom a to g in the igure. The truth table or the BCD-to-7-segment decoder is given in Figure 6.25c. For each valuation o the inputs,...,w, the seven outputs are set to

24 May 9, 24 :4 vra6857_ch6 Sheet number 24 Page number 338 black 338 CHAPTER 6 Combinational-Circuit Building Blocks c e w a b w c d e g (c) Truth table (a) Code converter w a w b c d e g a g b d (b) 7-segment display Figure 6.25 A BCD-to-7-segment display code converter. display the appropriate BCD digit. Note that the last 6 rows o a complete 6-row truth table are not shown. They represent don t-care conditions because they are not legal BCD codes and will never occur in a circuit that deals with BCD data. A circuit that implements the truth table can be derived using the synthesis techniques discussed in Chapter 4. Finally, we should note that although the word decoder is traditionally used or this circuit, a more appropriate term is code converter. The term decoder is more appropriate or circuits that produce one-hot encoded outputs. 6.5 Arithmetic Comparison Circuits Chapter 5 presented arithmetic circuits that perorm addition, subtraction, and multiplication o binary numbers. Another useul type o arithmetic circuit compares the relative sizes o two binary numbers. Such a circuit is called a comparator. This section considers the

25 May 9, 24 :4 vra6857_ch6 Sheet number 25 Page number 339 black 6.6 VHDL or Combinational Circuits 339 design o a comparator that has two n-bit inputs, A and B, which represent unsigned binary numbers. The comparator produces three outputs, called AeqB, AgtB, and AltB. The AeqB output is set to i A and B are equal. The AgtB output is i A is greater than B, and the AltB output is i A is less than B. The desired comparator can be designed by creating a truth table that speciies the three outputs as unctions o A and B. However, even or moderate values o n, the truth table is large. A better approach is to derive the comparator circuit by considering the bits o A and B in pairs. We can illustrate this by a small example, where n = 4. Let A = a 3 a 2 a a and B = b 3 b 2 b b. Deine a set o intermediate signals called i 3, i 2, i, and i. Each signal, i k, is i the bits o A and B with the same index are equal. That is, i k = a k b k. The comparator s AeqB output is then given by AeqB = i 3 i 2 i i An expression or the AgtB output can be derived by considering the bits o A and B in the order rom the most-signiicant bit to the least-signiicant bit. The irst bit-position, k, at which a k and b k dier determines whether A is less than or greater than B. Ia k = and b k =, then A < B. But i a k = and b k =, then A > B. The AgtB output is deined by AgtB = a 3 b 3 + i 3 a 2 b 2 + i 3 i 2 a b + i 3 i 2 i a b The i k signals ensure that only the irst digits, considered rom the let to the right, o A and B that dier determine the value o AgtB. The AltB output can be derived by using the other two outputs as AltB = AeqB + AgtB A logic circuit that implements the our-bit comparator circuit is shown in Figure This approach can be used to design a comparator or any value o n. Comparator circuits, like most logic circuits, can be designed in dierent ways. Another approach or designing a comparator circuit is presented in Example 5. in Chapter VHDL or Combinational Circuits Having presented a number o useul circuits that can be used as building blocks in larger circuits, we will now consider how such circuits can be described in VHDL. Rather than relying on the simple VHDL statements used in previous examples, such as logic expressions, we will speciy the circuits in terms o their behavior. We will also introduce a number o new VHDL constructs Assignment Statements VHDL provides several types o statements that can be used to assign logic values to signals. In the examples o VHDL code given so ar, only simple assignment statements have been used, either or logic or arithmetic expressions. This section introduces other types o

26 May 9, 24 :4 vra6857_ch6 Sheet number 26 Page number 34 black 34 CHAPTER 6 Combinational-Circuit Building Blocks a 3 i 3 b 3 a 2 i 2 b 2 AeqB a i b a i b AltB AgtB Figure 6.26 A our-bit comparator circuit. assignment statements, which are called selected signal assignments, conditional signal assignments, generate statements, i-then-else statements, and case statements Selected Signal Assignment A selected signal assignment allows a signal to be assigned one o several values, based on a selection criterion. Figure 6.27 shows how it can be used to describe a 2-to- multiplexer. The entity, named mux2to, has the inputs w, w, and s, and the output. The selected signal assignment begins with the keyword WITH, which speciies that s is to be used or the selection criterion. The two WHEN clauses state that is assigned the value o w when s = ; otherwise, is assigned the value o w. The WHEN clause that selects w uses the word OTHERS, instead o the value. This is required because the VHDL syntax speciies that a WHEN clause must be included or every possible value o the selection signal s.

27 May 9, 24 :4 vra6857_ch6 Sheet number 27 Page number 34 black 6.6 VHDL or Combinational Circuits 34 LIBRARY ieee ; USE ieee.std logic 64.all ; ENTITY mux2to IS PORT ( w, w, s : IN STD LOGIC ; : OUT STD LOGIC ) ; END mux2to ; ARCHITECTURE Behavior OF mux2to IS WITH s SELECT < w WHEN, w WHEN OTHERS ; END Behavior ; Figure 6.27 VHDL code or a 2-to- multiplexer. Since it has the STD_LOGIC type, discussed in section 4.2, s can take the values,, Z,, and others. The keyword OTHERS provides a convenient way o accounting or all logic values that are not explicitly listed in a WHEN clause. A 4-to- multiplexer is described by the entity named mux4to, shown in Figure The two select inputs, which are called s and s in Figure 6.2, are represented by the two-bit STD_LOGIC_VECTOR signal s. The selected signal assignment sets to the value o one o the inputs w,...,, depending on the valuation o s. Compiling the code results in the circuit shown in Figure 6.2c. At the end o Figure 6.28, the mux4to entity is deined as a component in the package named mux4to_package. We showed in section that the component declaration allows the entity to be used as a subcircuit in other VHDL code. Example 6.2 Figure 6.4 showed how a 6-to- multiplexer is built using ive 4-to- multiplexers. Figure 6.29 presents VHDL code or this circuit, using the mux4to component. The lines o code are numbered so that we can easily reer to them. The mux4to_package is included in the code, because it provides the component declaration or mux4to. The data inputs to the mux6to entity are the 6-bit signal named w, and the select inputs are the our-bit signal named s. In the VHDL code signal names are needed or the outputs o the our 4-to- multiplexers on the let o Figure 6.4. Line deines a our-bit signal named m or this purpose, and lines 3 to 6 instantiate the our multiplexers. For instance, line 3 corresponds to the multiplexer at the top let o Figure 6.4. Its irst our ports, which correspond to w,..., in Figure 6.28, are driven by the signals w(),...,w(3). Example 6.3

28 May 9, 24 :4 vra6857_ch6 Sheet number 28 Page number 342 black 342 CHAPTER 6 Combinational-Circuit Building Blocks LIBRARY ieee ; USE ieee.std logic 64.all ; ENTITY mux4to IS PORT ( w, w, w2, w3 : IN STD LOGIC ; s : IN STD LOGIC VECTOR( DOWNTO ) ; : OUT STD LOGIC ) ; END mux4to ; ARCHITECTURE Behavior OF mux4to IS WITH s SELECT < w WHEN, w WHEN, w2 WHEN, w3 WHEN OTHERS ; END Behavior ; LIBRARY ieee ; USE ieee.std logic 64.all ; PACKAGE mux4to package IS COMPONENT mux4to PORT ( w, w, w2, w3 : IN STD LOGIC ; s : IN STD LOGIC VECTOR( DOWNTO ) ; : OUT STD LOGIC ) ; END COMPONENT ; END mux4to package ; Figure 6.28 VHDL code or a 4-to- multiplexer. The syntax s( DOWNTO ) is used to attach the signals s() and s() to the two-bit s port o the mux4to component. The m() signal is connected to the multiplexer s output port. Line 7 instantiates the multiplexer on the right o Figure 6.4. The signals m,...,m 3 are connected to its data inputs, and bits s(3) and s(2), which are speciied by the syntax s(3 DOWNTO 2), are attached to the select inputs. The output port generates the mux6to output. Compiling the code results in the multiplexer unction = s 3 s 2 s s w + s 3 s 2 s s w + s 3 s 2 s s + +s 3 s 2 s s w 4 + s 3 s 2 s s w 5 Example 6.4 The selected signal assignments can also be used to describe other types o circuits. Figure 6.3 shows how a selected signal assignment can be used to describe the truth table or a 2-to-4 binary decoder. The entity is called dec2to4. The data inputs are the two-bit signal

29 May 9, 24 :4 vra6857_ch6 Sheet number 29 Page number 343 black 6.6 VHDL or Combinational Circuits 343 LIBRARY ieee ; 2 USE ieee.std logic 64.all ; 3 LIBRARY work ; 4 USE work.mux4to package.all ; 5 ENTITY mux6to IS 6 PORT ( w : IN STD LOGIC VECTOR( TO 5) ; 7 s : IN STD LOGIC VECTOR(3 DOWNTO ) ; 8 : OUT STD LOGIC ) ; 9 END mux6to ; ARCHITECTURE Structure OF mux6to IS SIGNAL m : STD LOGIC VECTOR( TO 3) ; 2 3 Mux: mux4to PORT MAP ( w(), w(), w(2), w(3), s( DOWNTO ), m() ) ; 4 Mux2: mux4to PORT MAP ( w(4), w(5), w(6), w(7), s( DOWNTO ), m() ) ; 5 Mux3: mux4to PORT MAP ( w(8), w(9), w(), w(), s( DOWNTO ), m(2) ) ; 6 Mux4: mux4to PORT MAP ( w(2), w(3), w(4), w(5), s( DOWNTO ), m(3) ) ; 7 Mux5: mux4to PORT MAP ( m(), m(), m(2), m(3), s(3 DOWNTO 2), ) ; 8 END Structure ; Figure 6.29 Hierarchical code or a 6-to- multiplexer. named w, and the enable input is En. The our outputs are represented by the our-bit signal y. In the truth table or the decoder in Figure 6.6a, the inputs are listed in the order En w w. To represent these three signals, the VHDL code deines the three-bit signal named Enw. The statement Enw <= En & w uses the VHDL concatenate operator, which was discussed in section 5.5.4, to combine the En and w signals into the Enw signal. Hence Enw(2) = En, Enw() = w, and Enw() = w. The Enw signal is used as the selection signal in the selected signal assignment statement. It describes the truth table in Figure 6.6a. In the irst our WHEN clauses, En =, and the decoder outputs have the same patterns as in the irst our rows o the truth table. The last WHEN clause uses the OTH- ERS keyword and sets the decoder outputs to, because it represents the cases where En =.

30 May 9, 24 :4 vra6857_ch6 Sheet number 3 Page number 344 black 344 CHAPTER 6 Combinational-Circuit Building Blocks LIBRARY ieee ; USE ieee.std logic 64.all ; ENTITY dec2to4 IS PORT ( w : IN STD LOGIC VECTOR( DOWNTO ) ; En : IN STD LOGIC ; y : OUT STD LOGIC VECTOR( TO 3) ) ; END dec2to4 ; ARCHITECTURE Behavior OF dec2to4 IS SIGNAL Enw : STD LOGIC VECTOR(2 DOWNTO ) ; Enw < En & w ; WITH Enw SELECT y < WHEN, WHEN, WHEN, WHEN, WHEN OTHERS ; END Behavior ; Figure 6.3 VHDL code or a 2-to-4 binary decoder Conditional Signal Assignment Similar to the selected signal assignment, a conditional signal assignment allows a signal to be set to one o several values. Figure 6.3 shows a modiied version o the 2-to- multiplexer entity rom Figure It uses a conditional signal assignment to speciy that is assigned the value o w when s =, or else is assigned the value o w. Compiling LIBRARY ieee ; USE ieee.std logic 64.all ; ENTITY mux2to IS PORT ( w, w, s : IN STD LOGIC ; : OUT STD LOGIC ) ; END mux2to ; ARCHITECTURE Behavior OF mux2to IS < w WHEN s ELSE w ; END Behavior ; Figure 6.3 Speciication o a 2-to- multiplexer using a conditional signal assignment.

31 May 9, 24 :4 vra6857_ch6 Sheet number 3 Page number 345 black 6.6 VHDL or Combinational Circuits 345 the code generates the same circuit as the code in Figure In this small example the conditional signal assignment has only one WHEN clause. A more complex example, which better illustrates the eatures o the conditional signal assignment, is given in Example 6.5. Figure 6.24 gives the truth table or a 4-to-2 priority encoder. VHDL code that describes this truth table is shown in Figure The inputs to the encoder are represented by the our-bit signal named w. The encoder has the outputs y, which is a two-bit signal, and z. The conditional signal assignment speciies that y is assigned the value when input w(3) =. I this condition is true, then the other WHEN clauses that ollow the ELSE keyword do not aect the value o. Hence the values o w(2), w(), and w() do not matter, which implements the desired priority scheme. The second WHEN clause states that when w(2) =, then y is assigned the value. This can occur only i w(3) =. Each successive WHEN clause can aect y only i none o the conditions associated with the preceding WHEN clauses are true. Figure 6.32 includes a second conditional signal assignment or the output z. It states that when all our inputs are, z is assigned the value ; else z is assigned the value. The priority level associated with each WHEN clause in the conditional signal assignment is a key dierence rom the selected signal assignment, which has no such priority scheme. It is possible to describe the priority encoder using a selected signal assignment, but the code is more awkward. One possibility is shown by the architecture in Figure The irst WHEN clause sets y to when w is the only input that is. The next two clauses state that y should be when = = and w =. The next our clauses speciy that y should be i = and =. Finally, the last WHEN clause states that y should be or all other input valuations, which includes all valuations or which is. Note that Example 6.5 LIBRARY ieee ; USE ieee.std logic 64.all ; ENTITY priority IS PORT ( w : IN STD LOGIC VECTOR(3 DOWNTO ) ; y : OUT STD LOGIC VECTOR( DOWNTO ) ; z : OUT STD LOGIC ) ; END priority ; ARCHITECTURE Behavior OF priority IS y < WHEN w(3) ELSE WHEN w(2) ELSE WHEN w() ELSE ; z < WHEN w ELSE ; END Behavior ; Figure 6.32 VHDL code or a priority encoder.

32 May 9, 24 :4 vra6857_ch6 Sheet number 32 Page number 346 black 346 CHAPTER 6 Combinational-Circuit Building Blocks LIBRARY ieee ; USE ieee.std logic 64.all ; ENTITY priority IS PORT ( w : IN STD LOGIC VECTOR(3 DOWNTO ) ; y : OUT STD LOGIC VECTOR( DOWNTO ) ; z : OUT STD LOGIC ) ; END priority ; ARCHITECTURE Behavior OF priority IS WITH w SELECT y < WHEN, WHEN, WHEN, WHEN, WHEN, WHEN, WHEN, WHEN OTHERS ; WITH w SELECT z < WHEN, WHEN OTHERS ; END Behavior ; Figure 6.33 Less eicient code or a priority encoder. the OTHERS clause includes the input valuation. This pattern results in z =, and the value o y does not matter in this case. Example 6.6 We derived the circuit or a comparator in Figure Figure 6.34 shows how this circuit can be described with VHDL code. Each o the three conditional signal assignments determines the value o one o the comparator outputs. The package named std_logic_unsigned is included in the code because it speciies that STD_LOGIC_VECTOR signals, namely, A and B, can be used as unsigned binary numbers with VHDL relational operators. The relational operators provide a convenient way o speciying the desired unctionality. The circuit generated rom the code in Figure 6.34 is similar, but not identical, to the circuit in Figure The VHDL compiler instantiates a predeined module to implement each o the comparison operations. In Quartus II the modules that are instantiated are rom the LPM library, which was introduced in section 5.5.

33 May 9, 24 :4 vra6857_ch6 Sheet number 33 Page number 347 black 6.6 VHDL or Combinational Circuits 347 LIBRARY ieee ; USE ieee.std logic 64.all ; USE ieee.std logic unsigned.all ; ENTITY compare IS PORT ( A, B : IN STD LOGIC VECTOR(3 DOWNTO ) ; AeqB, AgtB, AltB : OUT STD LOGIC ) ; END compare ; ARCHITECTURE Behavior OF compare IS AeqB < WHEN A B ELSE ; AgtB < WHEN A > B ELSE ; AltB < WHEN A < B ELSE ; END Behavior ; Figure 6.34 VHDL code or a our-bit comparator. Instead o using the std_logic_unsigned library, another way to speciy that the generated circuit should use unsigned numbers is to include the library named std_logic_arith. In this case the signals A and B should be deined with the type UNSIGNED, rather than STD_LOGIC_VECTOR. I we want the circuit to work with signed numbers, signals A and B should be deined with the type SIGNED. This code is given in Figure LIBRARY ieee ; USE ieee.std logic 64.all ; USE ieee.std logic arith.all ; ENTITY compare IS PORT ( A, B : IN SIGNED(3 DOWNTO ) ; AeqB, AgtB, AltB : OUT STD LOGIC ) ; END compare ; ARCHITECTURE Behavior OF compare IS AeqB < WHEN A B ELSE ; AgtB < WHEN A > B ELSE ; AltB < WHEN A < B ELSE ; END Behavior ; Figure 6.35 The code rom Figure 6.34 or signed numbers.

34 May 9, 24 :4 vra6857_ch6 Sheet number 34 Page number 348 black 348 CHAPTER 6 Combinational-Circuit Building Blocks Generate Statements Figure 6.29 gives VHDL code or a 6-to- multiplexer using ive instances o a 4-to- multiplexer subcircuit. The regular structure o the code suggests that it could be written in a more compact orm using a loop. VHDL provides a eature called the FOR GENERATE statement or describing regularly structured hierarchical code. Figure 6.36 shows the code rom Figure 6.29 rewritten using a FOR GENERATE statement. The generate statement must have a label, so we have used the label G in the code. The loop instantiates our copies o the mux4to component, using the loop index i in the range rom to 3. The variable i is not explicitly declared in the code; it is automatically deined as a local variable whose scope is limited to the FOR GENERATE statement. The irst loop iteration corresponds to the instantiation statement labeled Mux in Figure The * operator represents multiplication; hence or the irst loop iteration the VHDL compiler translates the signal names w(4 i), w(4 i + ), w(4 i + 2), and w(4 i + 3) into signal names w(), w(), w(2), and w(3). The loop iterations or i =, i = 2, and i = 3 correspond to the statements labeled Mux2, Mux3, and Mux4 in Figure The statement labeled Mux5 in Figure 6.29 does not it within the loop, so it is included as a separate statement in Figure The circuit generated rom the code in Figure 6.36 is identical to the circuit produced by using the code in Figure LIBRARY ieee ; USE ieee.std logic 64.all ; USE work.mux4to package.all ; ENTITY mux6to IS PORT ( w : IN STD LOGIC VECTOR( TO 5) ; s : IN STD LOGIC VECTOR(3 DOWNTO ) ; : OUT STD LOGIC ) ; END mux6to ; ARCHITECTURE Structure OF mux6to IS SIGNAL m : STD LOGIC VECTOR( TO 3) ; G: FOR i IN TO 3 GENERATE Muxes: mux4to PORT MAP ( w(4*i), w(4*i+), w(4*i+2), w(4*i+3), s( DOWNTO ), m(i) ) ; END GENERATE ; Mux5: mux4to PORT MAP ( m(), m(), m(2), m(3), s(3 DOWNTO 2), ) ; END Structure ; Figure 6.36 Code or a 6-to- multiplexer using a generate statement.

35 May 9, 24 :4 vra6857_ch6 Sheet number 35 Page number 349 black 6.6 VHDL or Combinational Circuits 349 In addition to the FOR GENERATE statement, VHDL provides another type o generate statement called IF GENERATE. Figure 6.37 illustrates the use o both types o generate statements. The code shown is a hierarchical description o the 4-to-6 decoder given in Figure 6.8, using ive instances o the dec2to4 component deined in Figure 6.3. The decoder inputs are the our-bit signal w, the enable is En, and the outputs are the 6-bit signal y. Following the component declaration or the dec2to4 subcircuit, the architecture deines the signal m, which represents the outputs o the 2-to-4 decoder on the let o Figure 6.8. The ive copies o the dec2to4 component are instantiated by the FOR GENERATE statement. In each iteration o the loop, the statement labeled Dec_ri instantiates a dec2to4 component that corresponds to one o the 2-to-4 decoders on the right side o Figure 6.8. The irst loop iteration generates the dec2to4 component with data inputs w and w, enable input m, and outputs y, y, y 2, y 3. The other loop iterations also use data inputs w w, but use dierent bits o m and y. The IF GENERATE statement, labeled G2, instantiates a dec2to4 component in the last loop iteration, or which the condition i = 3 is true. This component represents the 2-to-4 decoder on the let o Figure 6.8. It has the two-bit data inputs and, the enable En, and Example 6.7 LIBRARY ieee ; USE ieee.std logic 64.all ; ENTITY dec4to6 IS PORT ( w : IN STD LOGIC VECTOR(3 DOWNTO ) ; En : IN STD LOGIC ; y : OUT STD LOGIC VECTOR( TO 5) ) ; END dec4to6 ; ARCHITECTURE Structure OF dec4to6 IS COMPONENT dec2to4 PORT ( w : IN STD LOGIC VECTOR( DOWNTO ) ; En : IN STD LOGIC ; y : OUT STD LOGIC VECTOR( TO 3) ) ; END COMPONENT ; SIGNAL m : STD LOGIC VECTOR( TO 3) ; G: FOR i IN TO 3 GENERATE Dec ri: dec2to4 PORT MAP ( w( DOWNTO ), m(i), y(4*i TO 4*i+3) ); G2: IF i=3 GENERATE Dec let: dec2to4 PORT MAP ( w(i DOWNTO i-), En, m ) ; END GENERATE ; END GENERATE ; END Structure ; Figure 6.37 Hierarchical code or a 4-to-6 binary decoder.

36 May 9, 24 :4 vra6857_ch6 Sheet number 36 Page number 35 black 35 CHAPTER 6 Combinational-Circuit Building Blocks the outputs m, m, m 2, and m 3. Note that instead o using the IF GENERATE statement, we could have instantiated this component outside the FOR GENERATE statement. We have written the code as shown simply to give an example o the IF GENERATE statement. The generate statements in Figures 6.36 and 6.37 are used to instantiate components. Another use o generate statements is to generate a set o logic equations. An example o this use will be given in Figure Concurrent and Sequential Assignment Statements We have introduced several types o assignment statements: simple assignment statements, which involve logic or arithmetic expressions, selected assignment statements, and conditional assignment statements. All o these statements share the property that the order in which they appear in VHDL code does not aect the meaning o the code. Because o this property, these statements are called the concurrent assignment statements. VHDL also provides a second category o statements, called sequential assignment statements, or which the ordering o the statements may aect the meaning o the code. We will discuss two types o sequential assignment statements, called i-then-else statements and case statements. VHDL requires that the sequential assignment statements be placed inside another type o statement, called a process statement Process Statement Figures 6.27 and 6.3 show two ways o describing a 2-to- multiplexer, using the selected and conditional signal assignments. The same circuit can also be described using an i-thenelse statement, but this statement must be placed inside a process statement. Figure 6.38 shows such code. The process statement, or simply process, begins with the PROCESS keyword, ollowed by a parenthesized list o signals, called the sensitivity list. For a combinational circuit like the multiplexer, the sensitivity list includes all input signals that are used inside the process. The process statement is translated by the VHDL compiler into logic equations. In the igure the process consists o the single i-then-else statement that describes the multiplexer unction. Thus the sensitivity list comprises the data inputs, w and w, and the select input s. In general, there can be a number o statements inside a process. These statements are considered as ollows. Using VHDL jargon, we say that when there is a change in the value o any signal in the process s sensitivity list, then the process becomes active. Once active, the statements inside the process are evaluated in sequential order. Any assignments made to signals inside the process are not visible outside the process until all o the statements in the process have been evaluated. I there are multiple assignments to the same signal, only the last one has any visible eect. This is illustrated in Example 6.8.

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

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

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

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

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

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 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

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

FIXED INCOME ATTRIBUTION

FIXED INCOME ATTRIBUTION Sotware Requirement Speciication FIXED INCOME ATTRIBUTION Authors Risto Lehtinen Version Date Comment 0.1 2007/02/20 First Drat Table o Contents 1 Introduction... 3 1.1 Purpose o Document... 3 1.2 Glossary,

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

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

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

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

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

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

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

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

RAM & ROM Based Digital Design. ECE 152A Winter 2012

RAM & ROM Based Digital Design. ECE 152A Winter 2012 RAM & ROM Based Digital Design ECE 152A Winter 212 Reading Assignment Brown and Vranesic 1 Digital System Design 1.1 Building Block Circuits 1.1.3 Static Random Access Memory (SRAM) 1.1.4 SRAM Blocks in

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

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

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

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

Life Cycle of a Memory Request. Ring Example: 2 requests for lock 17

Life Cycle of a Memory Request. Ring Example: 2 requests for lock 17 Life Cycle of a Memory Request (1) Use AQR or AQW to place address in AQ (2) If A[31]==0, check for hit in DCache Ring (3) Read Hit: place cache word in RQ; Write Hit: replace cache word with WQ RDDest/RDreturn

More information

Lecture 8: Synchronous Digital Systems

Lecture 8: Synchronous Digital Systems Lecture 8: Synchronous Digital Systems The distinguishing feature of a synchronous digital system is that the circuit only changes in response to a system clock. For example, consider the edge triggered

More information

Modeling Sequential Elements with Verilog. Prof. Chien-Nan Liu TEL: 03-4227151 ext:34534 Email: jimmy@ee.ncu.edu.tw. Sequential Circuit

Modeling Sequential Elements with Verilog. Prof. Chien-Nan Liu TEL: 03-4227151 ext:34534 Email: jimmy@ee.ncu.edu.tw. Sequential Circuit Modeling Sequential Elements with Verilog Prof. Chien-Nan Liu TEL: 03-4227151 ext:34534 Email: jimmy@ee.ncu.edu.tw 4-1 Sequential Circuit Outputs are functions of inputs and present states of storage elements

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

University of St. Thomas ENGR 230 ---- Digital Design 4 Credit Course Monday, Wednesday, Friday from 1:35 p.m. to 2:40 p.m. Lecture: Room OWS LL54

University of St. Thomas ENGR 230 ---- Digital Design 4 Credit Course Monday, Wednesday, Friday from 1:35 p.m. to 2:40 p.m. Lecture: Room OWS LL54 Fall 2005 Instructor Texts University of St. Thomas ENGR 230 ---- Digital Design 4 Credit Course Monday, Wednesday, Friday from 1:35 p.m. to 2:40 p.m. Lecture: Room OWS LL54 Lab: Section 1: OSS LL14 Tuesday

More information

Memory Systems. Static Random Access Memory (SRAM) Cell

Memory Systems. Static Random Access Memory (SRAM) Cell Memory Systems This chapter begins the discussion of memory systems from the implementation of a single bit. The architecture of memory chips is then constructed using arrays of bit implementations coupled

More information

AM Receiver. Prelab. baseband

AM Receiver. Prelab. baseband AM Receiver Prelab In this experiment you will use what you learned in your previous lab sessions to make an AM receiver circuit. You will construct an envelope detector AM receiver. P1) Introduction One

More information

Mixed Logic A B A B. 1. Ignore all bubbles on logic gates and inverters. This means

Mixed Logic A B A B. 1. Ignore all bubbles on logic gates and inverters. This means Mixed Logic Introduction Mixed logic is a gate-level design methodology used in industry. It allows a digital logic circuit designer the functional description of the circuit from its physical implementation.

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

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

plc numbers - 13.1 Encoded values; BCD and ASCII Error detection; parity, gray code and checksums

plc numbers - 13.1 Encoded values; BCD and ASCII Error detection; parity, gray code and checksums plc numbers - 3. Topics: Number bases; binary, octal, decimal, hexadecimal Binary calculations; s compliments, addition, subtraction and Boolean operations Encoded values; BCD and ASCII Error detection;

More information

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas Take-Home Exercise Assume you want the counter below to count mod-6 backward. That is, it would count 0-5-4-3-2-1-0, etc. Assume it is reset on startup, and design the wiring to make the counter count

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

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

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

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

Modeling Latches and Flip-flops

Modeling Latches and Flip-flops Lab Workbook Introduction Sequential circuits are digital circuits in which the output depends not only on the present input (like combinatorial circuits), but also on the past sequence of inputs. In effect,

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

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

Quartus II Introduction Using VHDL Design

Quartus II Introduction Using VHDL Design Quartus II Introduction Using VHDL Design This tutorial presents an introduction to the Quartus R II CAD system. It gives a general overview of a typical CAD flow for designing circuits that are implemented

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

6 3 4 9 = 6 10 + 3 10 + 4 10 + 9 10

6 3 4 9 = 6 10 + 3 10 + 4 10 + 9 10 Lesson The Binary Number System. Why Binary? The number system that you are familiar with, that you use every day, is the decimal number system, also commonly referred to as the base- system. When you

More information

MACHINE INSTRUCTIONS AND PROGRAMS

MACHINE INSTRUCTIONS AND PROGRAMS CHAPTER 2 MACHINE INSTRUCTIONS AND PROGRAMS CHAPTER OBJECTIVES In this chapter you will learn about: Machine instructions and program execution, including branching and subroutine call and return operations

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

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

Lab 1: Introduction to Xilinx ISE Tutorial

Lab 1: Introduction to Xilinx ISE Tutorial Lab 1: Introduction to Xilinx ISE Tutorial This tutorial will introduce the reader to the Xilinx ISE software. Stepby-step instructions will be given to guide the reader through generating a project, creating

More information

Programming Logic controllers

Programming Logic controllers Programming Logic controllers Programmable Logic Controller (PLC) is a microprocessor based system that uses programmable memory to store instructions and implement functions such as logic, sequencing,

More information

8. Hardware Acceleration and Coprocessing

8. Hardware Acceleration and Coprocessing July 2011 ED51006-1.2 8. Hardware Acceleration and ED51006-1.2 This chapter discusses how you can use hardware accelerators and coprocessing to create more eicient, higher throughput designs in OPC Builder.

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

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

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

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

Seven-Segment LED Displays

Seven-Segment LED Displays Seven-Segment LED Displays Nicholas Neumann 11/19/2010 Abstract Seven-segment displays are electronic display devices used as an easy way to display decimal numerals and an alterative to the more complex

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

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

Finite State Machine Design and VHDL Coding Techniques

Finite State Machine Design and VHDL Coding Techniques Finite State Machine Design and VHDL Coding Techniques Iuliana CHIUCHISAN, Alin Dan POTORAC, Adrian GRAUR "Stefan cel Mare" University of Suceava str.universitatii nr.13, RO-720229 Suceava iulia@eed.usv.ro,

More information

Karnaugh Maps & Combinational Logic Design. ECE 152A Winter 2012

Karnaugh Maps & Combinational Logic Design. ECE 152A Winter 2012 Karnaugh Maps & Combinational Logic Design ECE 52A Winter 22 Reading Assignment Brown and Vranesic 4 Optimized Implementation of Logic Functions 4. Karnaugh Map 4.2 Strategy for Minimization 4.2. Terminology

More information

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products Chapter 3 Cartesian Products and Relations The material in this chapter is the first real encounter with abstraction. Relations are very general thing they are a special type of subset. After introducing

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

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

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

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

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program. Name: Class: Date: Exam #1 - Prep True/False Indicate whether the statement is true or false. 1. Programming is the process of writing a computer program in a language that the computer can respond to

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

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

NUMBER SYSTEMS. William Stallings

NUMBER SYSTEMS. William Stallings NUMBER SYSTEMS William Stallings The Decimal System... The Binary System...3 Converting between Binary and Decimal...3 Integers...4 Fractions...5 Hexadecimal Notation...6 This document available at WilliamStallings.com/StudentSupport.html

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

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

INTRODUCTION TO DIGITAL SYSTEMS. IMPLEMENTATION: MODULES (ICs) AND NETWORKS IMPLEMENTATION OF ALGORITHMS IN HARDWARE

INTRODUCTION TO DIGITAL SYSTEMS. IMPLEMENTATION: MODULES (ICs) AND NETWORKS IMPLEMENTATION OF ALGORITHMS IN HARDWARE INTRODUCTION TO DIGITAL SYSTEMS 1 DESCRIPTION AND DESIGN OF DIGITAL SYSTEMS FORMAL BASIS: SWITCHING ALGEBRA IMPLEMENTATION: MODULES (ICs) AND NETWORKS IMPLEMENTATION OF ALGORITHMS IN HARDWARE COURSE EMPHASIS:

More information

FINITE STATE MACHINE: PRINCIPLE AND PRACTICE

FINITE STATE MACHINE: PRINCIPLE AND PRACTICE CHAPTER 10 FINITE STATE MACHINE: PRINCIPLE AND PRACTICE A finite state machine (FSM) is a sequential circuit with random next-state logic. Unlike the regular sequential circuit discussed in Chapters 8

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

Digital Design. Assoc. Prof. Dr. Berna Örs Yalçın

Digital Design. Assoc. Prof. Dr. Berna Örs Yalçın Digital Design Assoc. Prof. Dr. Berna Örs Yalçın Istanbul Technical University Faculty of Electrical and Electronics Engineering Office Number: 2318 E-mail: siddika.ors@itu.edu.tr Grading 1st Midterm -

More information

Introduction to Programmable Logic Devices. John Coughlan RAL Technology Department Detector & Electronics Division

Introduction to Programmable Logic Devices. John Coughlan RAL Technology Department Detector & Electronics Division Introduction to Programmable Logic Devices John Coughlan RAL Technology Department Detector & Electronics Division PPD Lectures Programmable Logic is Key Underlying Technology. First-Level and High-Level

More information

VHDL GUIDELINES FOR SYNTHESIS

VHDL GUIDELINES FOR SYNTHESIS VHDL GUIDELINES FOR SYNTHESIS Claudio Talarico For internal use only 1/19 BASICS VHDL VHDL (Very high speed integrated circuit Hardware Description Language) is a hardware description language that allows

More information

Lecture 2. Binary and Hexadecimal Numbers

Lecture 2. Binary and Hexadecimal Numbers Lecture 2 Binary and Hexadecimal Numbers Purpose: Review binary and hexadecimal number representations Convert directly from one base to another base Review addition and subtraction in binary representations

More information

3-Digit Counter and Display

3-Digit Counter and Display ECE 2B Winter 2007 Lab #7 7 3-Digit Counter and Display This final lab brings together much of what we have done in our lab experiments this quarter to construct a simple tachometer circuit for measuring

More information

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C Embedded Systems A Review of ANSI C and Considerations for Embedded C Programming Dr. Jeff Jackson Lecture 2-1 Review of ANSI C Topics Basic features of C C fundamentals Basic data types Expressions Selection

More information

Design Methods for Binary to Decimal Converters Using Arithmetic Decompositions

Design Methods for Binary to Decimal Converters Using Arithmetic Decompositions J. of Mult.-Valued Logic & Soft Computing, Vol., pp. 8 7 Old City Publishing, Inc. Reprints available directly from the publisher Published by license under the OCP Science imprint, Photocopying permitted

More information

Why focus on assessment now?

Why focus on assessment now? Assessment in th Responding to your questions. Assessment is an integral part o teaching and learning I this sounds amiliar to you it s probably because it is one o the most requently quoted lines rom

More information

Power functions: f(x) = x n, n is a natural number The graphs of some power functions are given below. n- even n- odd

Power functions: f(x) = x n, n is a natural number The graphs of some power functions are given below. n- even n- odd 5.1 Polynomial Functions A polynomial unctions is a unction o the orm = a n n + a n-1 n-1 + + a 1 + a 0 Eample: = 3 3 + 5 - The domain o a polynomial unction is the set o all real numbers. The -intercepts

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

Gates, Plexers, Decoders, Registers, Addition and Comparison

Gates, Plexers, Decoders, Registers, Addition and Comparison Introduction to Digital Logic Autumn 2008 Gates, Plexers, Decoders, Registers, Addition and Comparison karl.marklund@it.uu.se ...open up a command shell and type logisim and press enter to start Logisim.

More information

Interfacing To Alphanumeric Displays

Interfacing To Alphanumeric Displays Interfacing To Alphanumeric Displays To give directions or data values to users, many microprocessor-controlled instruments and machines need to display letters of the alphabet and numbers. In systems

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

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

United States Naval Academy Electrical and Computer Engineering Department. EC262 Exam 1

United States Naval Academy Electrical and Computer Engineering Department. EC262 Exam 1 United States Naval Academy Electrical and Computer Engineering Department EC262 Exam 29 September 2. Do a page check now. You should have pages (cover & questions). 2. Read all problems in their entirety.

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

Sources: On the Web: Slides will be available on:

Sources: On the Web: Slides will be available on: C programming Introduction The basics of algorithms Structure of a C code, compilation step Constant, variable type, variable scope Expression and operators: assignment, arithmetic operators, comparison,

More information

Numbering Systems. InThisAppendix...

Numbering Systems. InThisAppendix... G InThisAppendix... Introduction Binary Numbering System Hexadecimal Numbering System Octal Numbering System Binary Coded Decimal (BCD) Numbering System Real (Floating Point) Numbering System BCD/Binary/Decimal/Hex/Octal

More information

Oct: 50 8 = 6 (r = 2) 6 8 = 0 (r = 6) Writing the remainders in reverse order we get: (50) 10 = (62) 8

Oct: 50 8 = 6 (r = 2) 6 8 = 0 (r = 6) Writing the remainders in reverse order we get: (50) 10 = (62) 8 ECE Department Summer LECTURE #5: Number Systems EEL : Digital Logic and Computer Systems Based on lecture notes by Dr. Eric M. Schwartz Decimal Number System: -Our standard number system is base, also

More information

C H A P T E R. Logic Circuits

C H A P T E R. Logic Circuits C H A P T E R Logic Circuits Many important functions are naturally computed with straight-line programs, programs without loops or branches. Such computations are conveniently described with circuits,

More information

Analog/Digital Conversion. Analog Signals. Digital Signals. Analog vs. Digital. Interfacing a microprocessor-based system to the real world.

Analog/Digital Conversion. Analog Signals. Digital Signals. Analog vs. Digital. Interfacing a microprocessor-based system to the real world. Analog/Digital Conversion Analog Signals Interacing a microprocessor-based system to the real world. continuous range x(t) Analog and digital signals he bridge: Sampling heorem Conversion concepts Conversion

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

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

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies ETEC 2301 Programmable Logic Devices Chapter 10 Counters Shawnee State University Department of Industrial and Engineering Technologies Copyright 2007 by Janna B. Gallaher Asynchronous Counter Operation

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

Module 3: Floyd, Digital Fundamental

Module 3: Floyd, Digital Fundamental Module 3: Lecturer : Yongsheng Gao Room : Tech - 3.25 Email : yongsheng.gao@griffith.edu.au Structure : 6 lectures 1 Tutorial Assessment: 1 Laboratory (5%) 1 Test (20%) Textbook : Floyd, Digital Fundamental

More information