ECE230L_Lab06

.pdf

School

Boise State University *

*We aren’t endorsed by this school

Course

230L

Subject

Electrical Engineering

Date

Apr 3, 2024

Type

pdf

Pages

10

Uploaded by PrivateSummer12964

Boise State University Electrical and Computer Engineering Department EE230L: Digital Systems Laboratory Lab 6: BCD Adder w/ Display Project Group: Team 31 Team Members: Maten Karim, Damian Guzman Experiment Date: 03/05/2024 Report Due: 03/08/2024
Title of Lab ECE 230L Page 2 of 10 1 Objective For this lab, we are creating a 4-bit BCD adder (binary-coded decimal). We will display the numbers we are adding and the result of the addition by using the seven segment display. The 4 bit binary adder from lab 3 will be used, with a bit of tweaking to ensure we get the results we are looking for. 2 Content Overview The 4 bit binary adder from lab 3 will give us the answer of two digits that add to 9 or less. The problem comes when the answer is more than 9, in our case it would be from 10-18. We want the most significant BCD value to be 1 while the least significant is the number from the 4 bit binary adder. To do this, we will add 6 to the output so our most significant bit will be a 1, while our least significant bits will be the correct results. By utilizing this technique, we can ensure the most significant BCD adder bit will be on and showing a 1 when the resultant is between 10 and 18. 2.1 Content Below, the block design for the BCD Adder can be seen. By utilizing a 4 bit adder and 2 bit adder, we can add values from 0 18. Figure 1: BCD Adder Block Design
Title of Lab ECE 230L Page 3 of 10 The simulation waveform below shows inputs up to x = 4 and y = 0. This shows the design is correct since it properly adds the numbers together and shows a 1 at the carry out when needed. Figure 2: Simulation Waveform The three separate images below of the simulation waveform depict output values of 5, 10, and 17. Figure 3: (0 + 5) = 05 Figure 4: (1 + 9) = 10
Title of Lab ECE 230L Page 4 of 10 Figure 5: (8 + 9) = 17 The above simulation waveforms were all produced by the testbench that is provided in the appendices, section 5.1. 2.2 Results Overall, this part of the lab was very straightforward. Creating the block design did take some trial and error but we were able to figure it out. The simulation waveforms clearly show that our implementation works correctly. Question 1: For the case of switches signal (switches[7:0]) equal to 56 in hexadecimal, what two numbers are you adding? I.e. what two numbers are the inputs for your adder? Explain your answer. Hint: In hex, each digit represents 4 bits. We are adding 5 and 6 together. 56 in decimal form is 86 and 86 in binary code is 1010110. This binary code can be seen as 1010 0110. These two values 1010 and 0110 are equal to 5 and 6. Question 2: For the same case in the waveform, list the result (leds[4:0]) showing the value in decimal, hexadecimal, and binary. Does each representation make sense? Explain your answer. The result for leds[4:0] is being shown in decimal form. When viewing the value of the leds[4:0] it shows each led value in 1s and 0s. When the overall value is given, it is then translated into decimal form. Question 3: For the same case, what would be the result (in hexadecimal) if we were adding those numbers using a 4-bit binary adder instead of the BCD adder? 5+6=11 which in hexadecimal is B.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help