Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

For Project 2, we built a hexadecimal (0-9 then A-F) counter, turned it into a two-digit hexadecimal counter, and then made a 4-bit number adder (which would result in a 5-bit number). The pins/buttons on the breadboard were used to control the number displayed on the seven-segment displays.

For Task 1, I created a circuit in VHDL that would take in 4 bits and use them to control the seven parts of the seven-segment display and create combinations of the segments to make numbers and letters. 3, for example, was made by having segments 0, 3, 4, 5, and 6 on. The decimal number 3 in 4-bit binary is 0011, so my VHDL file had segments 0, 3, 4, 5,  and 6 equal 1 when the input was 0011. This was done for all 7 segments; each one was told which number to be on for. In order to change the number that is input, a counter is needed, which would count from 0000 (0 in hexadecimal) to 1111 (F in hexadecimal). To that end, I put a counter into a BDF (block diagram file), which counts up from 0000 to 11111, and which goes back to zero either after being pressed following reaching F or when the reset button is pressed at any time. The output from the counter goes through the symbol file version of the VHDL file (called "real7seg" here), then gets output to the 7 segments making up one of the 7-segment displays on the breadboard. Task 1's block diagram picture is not included, but follows closely to that of Task 2, pictured beneath its description.

Task 2 was to make a counter that, like the one in Task 1, counts up from 0 to F, except this time, on two 7-segment displays, and in 8-bit binary. I only had to make a few changes from the files in Task 1. First of all, the counter for this goes up to 8 bits (0 to 7) instead of 4 (0 to 3). Next, I split the counter output into two halves-- one for the first seven-segment display (the ones' place) and another for the second (the tens' place). This was because the higher half of the counter is linked to the first set of 4, and after that, it naturally goes on to the first bit in the tens' place, then resets all the others below to zeroes again, meaning that linking the first four (left to right) bits to the tens' place output and the last 4 bits to the ones' place output would work. For instance, 0000 1111 would be 0F, then on the next count up, it would be 0001 0000, or 10. Therefore, the outputs displayed on the breadboard range from 00 to FF, or 0 to 255. The information on the segments for the provided number is input into the display, and this is done for both the first and second displays. An image of my block design is shown below:

For Task 3, we had to build a circuit that adds two user-determined 4-bit binary numbers. Instead of a counter, the idea was to use 4 switches to control each bit of a 4-bit number. There would be 8 switches in total that would be used, the first four for the first addend and the next four for the second addend. The screen would display the sum in hexadecimal, on two seven-segment screens, much like the way the numbers showed up in Task 2. I started off having 8 inputs, connected to the adding driver I made in VHDL (called "P2Part3driver" here). The adder takes all of the inputs, adds them, and puts the first four (right to left) bits into the displaying driver. The most significant bit, result[4], goes through an AND gate (which was done to assign it to a new variable), then goes through the displaying driver. Both seven-segment displays then work together to show the result of adding any 4-bit binary numbers in hexadecimal. 

  • No labels