Just do task one and two and three as it ask in the lab repo
Solution
A)we need to familiarize ourselves with the 7 segment module. These modules are made up of 8 LEDs, 7 of which make an \"8\" pattern and 1 for the decimal point. Using the 7 segments, you can make any decimal digit.
The modules we will be using have a common cathode. This means that the negative side of all the LEDs are connected together. This connection is available on pins 3 and 8.
Each segment is identified by a letter as can be seen below as well as the pinout and schematic for reference.
Now we will build a very simple circuit to drive a single digit. We will use a DIP switch to turn various segments on and off. Since this is being powered by a 9V battery, I am using 1.3K resistors for each LED segment. This provides a little over 5ma for each segment. I used the LED resistor calculator on ohmslawcalculator.com to help select the right size here.
With this circuit, you can create any decimal digit you want, plus some things that aren’t valid digits or characters.
Now controlling a 7 segment display like this is OK, but we can do much better. With the 4511 - BCD to 7 Segment Latch/Decoder/Driver we can drive the display with just 4 lines. Each 4511 IC takes a binary number as an input, then outputs the necessary lines to display that number on the 7 segment display.
For normal operation, Latch Enable (LE) is held high, but when it is grounded, the 4511 takes the 4 line input and updates its internal registers. The segments are then displayed on the basis of those internal registers.
The input will be a Binary Coded Decimal (BCD) which means that each decimal digit is individually coded in binary. For example the decimal number “32” is 00010000 in binary and 00110010 in BCD.
INSTRUCTIONS
This experiment is more of an introduction to the 4511 decoder/display driver IC than it is a lesson in how to “build up” a digital function from lower-level components. Since 7-segment displays are very common components of digital devices, it is good to be familiar with the “driving” circuits behind them, and the 4511 is a good example of a typical driver IC.
Its operating principle is to input a four-bit BCD (Binary-Coded Decimal) value, and energize the proper output lines to form the corresponding decimal digit on the 7-segment LED display. The BCD inputs are designated A, B, C, and D in order from least-significant to most-significant. Outputs are labeled a, b, c, d, e, f, and g, each letter corresponding to a standardized segment designation for 7-segment displays. Of course, since each LED segment requires its own dropping resistor, we must use seven 470 resistors placed in series between the 4511’s output terminals and the corresponding terminals of the display unit.
Most 7-segment displays also provide for a decimal point (sometimes two!), a separate LED and terminal designated for its operation. All LEDs inside the display unit are made common to each other on one side, either cathode or anode. The 4511 display driver IC requires a common-cathode 7-segment display unit, and so that is what is used here.
After building the circuit and applying power, operate the four switches in a binary counting sequence (0000 to 1111), noting the 7-segment display. A 0000 input should result in a decimal “0” display, a 0001 input should result in a decimal “1” display, and so on through 1001 (decimal “9”). What happens for the binary numbers 1010 (10) through 1111 (15)? Read the datasheet on the 4511 IC and see what the manufacturer specifies for operation above an input value of 9. In the BCD code, there is no real meaning for 1010, 1011, 1100, 1101, 1110, or 1111. These are binary values beyond the range of a single decimal digit, and so have no function in a BCD system. The 4511 IC is built to recognize this, and output (or not output!) accordingly.
Three inputs on the 4511 chip have been permanently connected to either Vdd or ground: the “Lamp Test,” “Blanking Input,” and “Latch Enable.” To learn what these inputs do, remove the short jumpers connecting them to either power supply rail (one at a time!), and replace the short jumper with a longer one that can reach the other power supply rail. For example, remove the short jumper connecting the “Latch Enable” input (pin #5) to ground, and replace it with a long jumper wire that can reach all the way to the Vdd power supply rail. Experiment with making this input “high” and “low,” observing the results on the 7-segment display as you alter the BCD code with the four input switches. After you’ve learned what the input’s function is, connect it to the power supply rail enabling normal operation, and proceed to experiment with the next input (either “Lamp Test” or “Blanking Input”).
Once again, the manufacturer’s datasheet will be informative as to the purpose of each of these three inputs. Note that the “Lamp Test” (LT) and “Blanking Input” (BI) input labels are written with boolean complementation bars over the abbreviations. Bar symbols designate these inputs as active-low, meaning that you must make each one “low” in order to invoke its particular function. Making an active-low input “high” places that particular input into a “passive” state where its function will not be invoked. Conversely, the “Latch Enable” (LE) input has no complementation bar written over its abbreviation, and correspondingly it is shown connected to ground (“low”) in the schematic so as to not invoke that function. The “Latch Enable” input is an active-high input, which means it must be made “high” (connected to Vdd) in order to invoke its function.
For the seven segment display we will be using the LSD5061-11 chip. Each of the segments of the display is connected to a pin on the 8051 (the schematic shows how to do this). In order to light up a segment on the the pin must be set to 0V. To turn a segment off the corresponding pin must be set to 5V. This is simply done by setting the pins on the 8051 to \'1\' or \'0\'. See the figure below to determine which segment corresponds to which pin. This will be important when you fill in you lookup table.
| Segment number | LSD5061-11 Pin number | 8051 pin number |
| s1 | pin 1 | P2.0 |
| s2 | pin 2 | P2.1 |
| s3 | pin 4 | P2.2 |
| s4 | pin 6 | P2.3 |
| s5 | pin 7 | P2.4 |
| s6 | pin 9 | P2.5 |
| s7 | pin 10 | P2.6 |

