正在加载图片...
D a)Full adder circuit b)Full adder symbol 99/18 样中的的 c)Full adder truth table d)Four-bit ripple-carry adder circuit Figure 2.A ripple-carry adder circuit. 2.Use switches sw and swao to represent the inputs A and B.respectively.Use sWa for the carry-in 发 3nasaenmsgmasrcDE2adcopkk6iaRaonndRo 4.Test your circuit by trying different values for numbersA.B,and PartIV In part II we discussed the conversion of binary numbers into decimal digits.It is sometimes useful to build 。mwm论C器起 You are to design a circuit that adds two BCD digits.The inputs to the circuit are BCD numbers A and B. 1.Create a new Quartus lI project for your BCD adder.You should use the four-bit adder circuit from part hich has a four-t binary-todecimal converter from part Write your HDL code using statements to specify the required logic functions-do not use other types of VHDL statements such as IF-ELSE or CASE statements for this part of the exercise.FA 0 1 ci a) Full adder circuit a b co s ci a b co s b) Full adder symbol FA a0 b0 s0 FA c1 a1 b1 s1 FA c2 a2 b2 s2 FA c3 a3 b3 s3 cout d) Four-bit ripple-carry adder circuit cin 0 0 c) Full adder truth table a ci b 0 0 0 1 0 0 1 0 1 1 100 1 1 0 1 1 0 111 0 0 c s o 0 1 0 1 1 0 0 1 1 1 0 0 1 1 Figure 2. A ripple-carry adder circuit. 1. Create a new Quartus II project for the adder circuit. Write a VHDL entity for the full adder subcircuit and write a top-level VHDL entity that instantiates four instances of this full adder. 2. Use switches SW7−4 and SW3−0 to represent the inputs A and B, respectively. Use SW8 for the carry-in cin of the adder. Connect the SW switches to their corresponding red lights LEDR, and connect the outputs of the adder, cout and S, to the green lights LEDG. 3. Include the necessary pin assignments for the DE2 board, compile the circuit, and download it into the FPGA chip. 4. Test your circuit by trying different values for numbers A, B, and c in. Part IV In part II we discussed the conversion of binary numbers into decimal digits. It is sometimes useful to build circuits that use this method of representing decimal numbers, in which each decimal digit is represented using four bits. This scheme is known as the binary coded decimal (BCD) representation. As an example, the decimal value 59 is encoded in BCD form as 0101 1001. You are to design a circuit that adds two BCD digits. The inputs to the circuit are BCD numbers A and B, plus a carry-in, cin. The output should be a two-digit BCD sum S1S0. Note that the largest sum that needs to be handled by this circuit is S1S0 = 9 + 9 + 1 = 19. Perform the steps given below. 1. Create a new Quartus II project for your BCD adder. You should use the four-bit adder circuit from part III to produce a four-bit sum and carry-out for the operation A + B. A circuit that converts this five-bit result, which has the maximum value 19, into two BCD digits S1S0 can be designed in a very similar way as the binary-to-decimal converter from part II. Write your VHDL code using simple assignment statements to specify the required logic functions–do not use other types of VHDL statements such as IF-ELSE or CASE statements for this part of the exercise. 3
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有