CMOS Logic Experiments

Introduction

Some CMOS Logic experiments were performed in December 2008 and a few of them are presented on this page. This is a new area for me. Be forewarned! CMOS circuits are extremely addictive. I learned that Ugly Construction works very well for CMOS logic circuits and when observing static precautions did not have any device failures due to my bread boarding. The inspiration for this web page was the CMOS Cookbook by Don Lancaster. This book is out of print, but remains a true classic for understanding and applying CMOS logic. Lancaster is a stellar author, with sharp wit and the ability to explain complex topics in a easy-to-understand manner. Please consider downloading a datasheet for each of the CMOS devices you use for the detailed pin out and other information to better understand the chip. Much learning occurred while viewing these datasheets.

 

A Big Number Eight

To the left is the output of this experiment; a large, 7-segment, common-cathode LED display. It counts from 0 to 9 at a potentiometer adjustable speed. The CMOS ICS used were a 4011B Quad 2-input NAND gate, a 4518B dual BCD up counter, and a 4511B BCD to 7 segment decoder/driver. Part substitution opportunities are numerous; for example you might use a 4510B single BCD counter and any number of chips for the main oscillator. A 4518B which is just 0.84 Canadian dollars from Digi-Key was purchased instead of the 4510B because it is a more versatile experimenter part with its 2 counters.

This big LED display is really eye catching and can be seen from quite a distance. Normally, experimental projects such as receivers are best built backwards, however with simple logic circuits this is not necessary. With logic circuits, you can test with LEDS or a logic probe and as appropriate, apply truth tables to ensure correct function from start to finish.

 

In Figure 1 is the astable oscillator or pulse generator schematic. Only 2 of the 4 NAND gates are used and the unused inputs are grounded. After studying basic gate topologies, it is easy to understand that the 2 NAND gates are actually connected up as inverters or using better terminology, inverting NOT gates. One could just as easily spend 31 cents more and use a pair of NOT gates on a 4049 for this timer circuit. The pulse frequency is 0.73 to 1.45 Hertz and is derived from the equation shown with R in ohms and C in farads. I adjusted my potentiometer to obtain a frequency of 1 Hertz like a time clock.

The output of this circuit is connected to pin 1 of the 4518. In addition, a transistor sinks (grounds) an LED on each pulse. If you were just using this oscillator to flash an LED, the LED anode could be directly connected to the pin 4 output via a 1K current limiting resistor and the cathode grounded. In this case, the LED is added to monitor the output. Throughout this experimental project, the output logic is monitored and the visual displays provide additional learning and built-in troubleshooting. Note that the 4011 IC is shown bottom side up like it was soldered onto the Ugly Construction bread board. Pins 7, 8,9,12 and13 were soldered directly to the copper surface well anchoring the IC. A number of great logic tutorials may be found on the World Wide Web using your favorite search engine.


To the left in Figure 2 is the second stage which uses half of a 4518B Binary Coded Decimal 4-stage counter. There is a single input on pin 1 which connects to the pulse generator output of Figure 1. The 4518 has outputs labeled A, B, C and D respectively. Each positive-going transition of the timer advances the counter by 1. The 4 outputs are sequentially changed to represent the decimal numbers from 0 to 9. Thus it is called a binary to decimal counter. Pin 3 is A, pin 4 is B, pin 5 is C and pin 6 is D. Each of the output pins connect to the appropriate input of the 7 segment decoder IC shown in Figure 4. Additionally, the binary state of each is monitored by an LED. When an output pin is HIGH (1) , the LED is lit and when the output is LOW (0), the LED is unlit.  The 4518 is shown upside down or (bottom side up) just like it was soldered onto the copper clad board.

Each decimal number has its own own binary sequence which uses 4 bits; A, B, C and D. The output follows the table shown in Figure 3. Most book and charts express the BCD table going from D to A. I observed this output in the LED connected to A, B, C and D. A different color LED was used on each output and the timer was slowed maximally to gather my data. It was really cool to observe and understand the binary-decimal coding system of the 4518. I wish you could get such clear feedback in RF circuits.

 

To the right is a reverse angle photograph of the entire project. The seven segment display is decoding the number 5. In the foreground are the LEDs monitoring the output of the 4011 and 4518 ICs. although it is difficult to see in the photograph, the single lit LED indicates an output pulse from the timer circuit. The 2 lit LEDs closer to the big 7-segment digit are the A and C output monitors. B and D are LOW and thus are switched off.
My experimenter bread board is very messy looking and it would be great to build a nicer looking version in a clear plastic chassis for a nephew or other relative.











In Figure 4 are the correct connection requirements for the 4511 and also how to construct the 4 LED, 7-segment digit. Note the IC and the LED segment maps are shown as they were wired; in bottom or reverse view. I first tested the 4511 output by connecting a common cathode LED with a 1K current limiting resistor to each of the seven outputs. The seven segment digit is 7 cm high and 3.5 cm wide. It was wired up and tested segment by segment and finally added to the main circuit after proper function was observed.

This is likely a good project for young experimenters or perhaps for those young at heart. Maximum current draw occurs on the digit 8 and was 98 mA. You can leave off the 4011 and 4518 monitoring LEDs, but I believe they enhance this project.


Shown in Figure 5 was another small experiment made with the 4511. The A, B, C and D inputs were disconnected from the 4518 output pins. A 10K pull down resistor was connected between each of the four 4511 input pins and ground. This resistor is needed or the inputs may "float" and not be definitively LOW when not connected to a HIGH signal. Although switches S1 - S4 are depicted, I just used 4 test leads containing alligator clips which were connected to the 12 volt supply at one end. I manually set each digit from 0 to 9 according to the Figure 3 table by connecting or disconnecting the test leads. For example with no test leads connected, the digit decoded 0. This simple experiment was quite enjoyable.

 

Shown above is the 4 LED, 7-segment digit built using Ugly Construction.


Roll The Dice

When I was a kid, a neighbor built electronic dice from a kit containing 3 chips. I remember being very intrigued with this device and now, about 30 years later, I finally built one. Presented is the classic Don Lancaster circuit which is a great example of functional brevity .Only one die was constructed, although it is easy to add the second die. This project uses 4011B and 4018B CMOS ICs and 7-14 LEDs. To the left is a close up photograph of the 4011 oscillator. I did not have a push button momentary switch, and just soldered a junk-box switch directly to the copper surface to anchor it and to ground one pole.

When the switch is closed to roll the dice, the oscillator starts and cycles a ring counter until the user releases the switch. All the LEDS are lit during the data recirculation state and according to Lancaster this circuit has true dice odds. He has methods to improve this basic circuit in the CMOS Cookbook, but it would likely be easier to build it with a PIC microprocessor if you really want hard-core electronic dice. To add a second die, replicate the exact 4018/LED circuit, except leave off the pin 14 connection to the 4011 oscillator. Pin 14 of the second 4018 is connected to pin 13 of the first 4018 instead. Use pins 12, 13 and 11 (output) of the 4011 for the NAND gate. Most builders historically ran this circuit with a 9 volt battery. Maximum current draw with a new 9 volt battery is about 10.5 mA. At 12v the measured current with all of the LEDSs on during cycling was around 17mA. This circuit will likely wet your appetite to learn more about counters. There are some really fabulous online counter and flip-flop tutorials and references which truly humble me as a novice logic experimenter. Use Google or another search engine to find them.

Note that the Figure 6 schematic is shown in Ugly Construction View with the chips upside down and grounded pins soldered directly to the copper surface. In all Ugly Construction circuits using ICs, double and then triple check to make sure you have the chip pin out understood 100% before you flip over the IC and solder the grounded pins to the copper surface. I draft my schematics exactly as shown on this web page; i.e. they consider the reverse and spatial orientation of the chip, have the pins numbered and show grounded pins for orientation purposes. Frequent pin counting and double checking to ensure you did not err is necessary to save frustration and to build confidence. Refrain from using too much solder as 2 bad outcomes may arise; an unwanted bridge between adjacent pins, or worse yet - a solder "drip" to the copper surface below which shorts the pin to ground. Both problems are potentially fixable should they occur, but prevention is better than therapy any day.






Crystal Oscillator


Using a 4049B, I built my first CMOS crystal oscillator. The series capacitor (C1 in Figure 7B) was found experimentally. The specified load capacitance for the particular 5.0 MHz crystal used was 18 pF. A 10 pF capacitor in the C1 slot pretty much achieved this. The output power of Figure 7A was 4.3 dBm into a 51 ohm resistor. The oscilloscope output wave form is shown. Current draw with a 12 volt power supply was around 12.5 mA.

In Figure 7B, a simple pi low pass filter was added and I was surprised how much this filter cleaned up the output waveform. The low pass filter 3 dB cutoff frequency was 5.68 MHz; so standard value capacitors could be used. The inductor was 17 turns of 26 gauge wire quickly wound on a T50-2 powdered iron torroid core.




Logic Monitors


Three simple logic monitor designs were built and tested. These are in fact, state monitors; high or low. LEDs were used as the visual state indicator. In 1 LED logic probes, when the LED is lit, the state is high and when it is unlit the state is low. For CMOS, ideally, the low state should be near to ground or 0 volts and the high state should be near the V+. After performing these experiments, I learned that in fact, the low state voltage can range from 0 to just below 2 volts when using a 12 volt power supply. Thus a logic monitor should likely indicate low at DC voltages less than 2 volts or so. An old voltmeter probe was used as the positive logic probe, while the ground probe was a wire and alligator clip. A 100K potentiometer connected to the V+ was used to determine the voltage which informed the high state in my circuits during testing. Results may vary with different LEDs. Cheap, red, opaque LEDs turned on at a lower voltage than yellow or blue LEDS in my simple experiments.




In Figure 8a is the first circuit I experimentally built. A photograph of this circuit is shown directly above. It uses 2N3904 transistors in the Darlington configuration. A transition state occurs in these LED circuits; they dimly glow just before the transistor(s) saturate to fully turn on the LED. The on state of these circuits is indicated when the LED is fully bright. Circuit A can likely be used for 5 to 15 volt supply voltages. The LED will not light at all until 1.5 volts appears on the input. At 2.02 volts, the LED is fully on and at its brightest. Circuit B is even more popcorn. It would likely be good for a V+ of 10 volts or greater.


An attempt to replicate the Figure 8a circuit using a 4049B was made and is shown in Figure 9. The red LED I used turned on at 2.14 volts and was fully bright at 3.06 volts. Using parallel NOT gates decreases the voltage required to turn on the LED as compared to using a single inverter.
The Figure 8 and 9 circuits draw around 10 mA when the LED is fully on.
Please consider using these circuits only as a guide and build and test according to your own parts and needs.



The Figure 9 bread board. Pins 9,11 and 14 of the 4049 were not grounded as I wanted to re-use this IC in the future for other experiments. In final projects it is recommended to ground the unused inputs. The plastic, TO-92 cased 5 volt regulator is hidden behind the LED.


Additional Outputs