NOR Gate

The NOR gate is a universal logic gate that can be built using only two transistors. It can be thought of as the not OR gate or having inverted logic to the OR gate. This is a useful logic gate as it was the core logic gate used in the Apollo Guidance Computer. There were two versions of the computer, the first used 4,100 NOR gates with each gate being built on separate integrated circuits. This was the first computer based on silicon-based integrated circuits. The second version used 2,800 integrated circuits which mostly had two NOR gates on each IC.

nor gate

The circuit above shows a NOR gate that is built on a breadboard using two transistors, three resistors, three ground wires, one jumper wire, and a yellow LED. Power is supplied with a 5-volt external battery pack. Both inputs A and B are on which is why the output is off. The only case where the output is on is when both inputs A and B are off.

This video shows how to build all types of logic gates. At 38:08 the NOR gate is discussed in detail. How to build an AND gate, OR gate, and XOR gate with NOR gates is also demonstrated.  A NAND gate can also be built with NOR gates but that would not be used very often as a NAND gate can also be built with two transistors.

NOR Gate Truth Table

nor gate truth table

The NOR gate symbol and truth table are shown above. Its symbol looks like an OR gate but has a circle to illustrate that it has inverted logic. The truth table makes it clear that the output is on when both inputs A and B are off. In all other cases, one or more inputs will be on and the output will be off. This is the opposite logic of an OR gate.

NOR Gate Circuit Diagram

nor gate circuit diagram

The circuit above shows a simple way to build a NOR gate. How each connection between the collector, base, and emitter of each transistor is made with the resistors and ground is clearly shown. This is not the only way to make a NOR gate though as four NAND gates can also be used to build a NOR gate. Since the NOR gate is a universal digital logic gate it can be used to make all the other types of logic gates.

Breadboard, Components, Tools, and Power Supply

Breadboards are used to build and test electrical circuits. These are used by hobbyists and professional electrical engineers. Using a breadboard allows for electrical connections to be made without using solder which is why they are also called solderless breadboards. Not having to make a permanent connection with solder makes it so the placement of wires and discrete components such as resistors, LEDs, and transistors can be easily changed.

A breadboard is typically used in the prototyping stage of a circuit design. This makes it so that mistakes can be made without having to build an entirely new printed circuit board (PCB). Different designs can be tested quickly with almost instant results.  Sometimes it is easier to design circuits in a circuit simulator. However, at some point in the circuit design, it should be tested with actual components to verify it works as expected. Once a final design is made on a breadboard it can then be made on a PCB which makes the circuit smaller, and easier to mass produce.

breadboard

Buy from Amazon

Having high quality breadboards is important as cheap breadboards can have defects and shorts that cause problems within the circuit. For small projects most breadboards will work but for larger projects I recommend getting the brand Busboards. In the long run it will save you time and the breadboards should last longer.

There are several different size breadboards but each one is built in a similar way. Power is supplied to the power rails which run along the outside of the breadboard. The power rails are horizontal rows. On the inside, there is a grid of holes where the rows are labeled a-j and the columns are numbered 1-60. The holes in the power rail rows are electrically connected but the rows on the inside are not electrically connected. Vertical columns are electrically connected between rows a-e and rows f-j.

The power rails are labeled + and – for where the positive and negative terminals of the power supply should be connected. Multiple breadboards can be connected together by sliding the tabs of one breadboard into the grooves of another. A breadboard can also be secured to a flat surface as the bottom has a sticky layer that can be exposed by removing the paper backing.

working with breadboards

In the photo above I am working on multiple breadboard projects involving digital logic gates. An oscilloscope is used to measure voltages within the circuits. On the desk, there is a large number of cut wire scraps as each wire is custom cut to length. Both full-size and half-size breadboards are being used.

Breadboard Components

Wire

all the different types of breadboard wires

There are three different types of wires used for breadboarding. These are jumper wires, spools for wire, and pre-cut wire. Each will be discussed in detail below.

breadboard jumper wires male to male connector

Flexible jumper wires are the quickest and easiest way to make a wire connection on a breadboard. These are made with multistrand wire with a PVC coating. Multistrand cable is flexible but does not fit well into breadboard holes. For this reason, there are metal pins on the end that fit properly into the holes of the breadboard. The disadvantage of using jumper wires is the extra length of wire makes it less clear where each wire is going to and from. This is especially true when lots of wired connections are made. Jumper cables are great for quick testing but are not to build circuits to take pictures of and show circuit designs to others.

breadboard wire kit with precut wires

Precut wires can be nice because the wires are cut and bent to specific lengths. This does help speed up the process when breadboarding. The problem is that the wires are color coated based on length. Often times when building circuits it is nice to color code the wires based on the connection type. For example black going to the ground, red going to the positive rail, blue wires sending data, etc. I do use precut wire when the wire I need is shorter than the precut wire. This way I can cut it down and still use the color I want. It saves some time as one end is stripped and bent already.

solid copper wire spools 22 gauge wire for breadboard

Buy from Amazon

The best wire to use for breadboards comes on spools. It is a 22 gauge solid core wire. Each spool has over 25 feet of wire. Common wire colors are red, black, yellow, blue, white, and green. The disadvantage of the wire spools is that each wire needs to be cut to length and stripped on both sides to expose the wire. When this is done properly it makes for a very nice-looking circuit where it is easy to see where the wires are going to and from. So it is often worth the extra time. Each wire should be cut so that it lays flat and the stripped ends fit securely in the holes.

Resistors

resistors for breadboards

Buy from Amazon

Resistors are one of the most common components used when breadboarding. Each resistor is marked with color-coated bands to display its value. Common resistor values used for breadboards range from 1 ohm to 1 mega ohm which is 1 million ohms. Often times the exact value of the resistor is not needed so one with a slightly higher value should be used. For example, if your calculations show you need a 945-ohm resistor, using a 1K resistor will work in most cases.

Resistors come with long wires on each end that need to be cut and bent to fit properly in the breadboard. The full length can be used but in most cases, this will make the resistor sit high above the breadboard. Having resistors lie flat makes the breadboard look more organized and is easier to see where connections are being made.

LEDs

LEDs for breadboards

Buy from Amazon

LEDs are often used in breadboards to show that the power is on. Using an oscilloscope or multimeter can provide the exact power value. However, often times it is advantageous to just see that power is on. Also, the brightness of the LED gives insight into how much current is being applied across the LED. When using LEDs it is important to have a current-limiting resistor or the LED can be damaged.

Most LEDs have a voltage drop ranging from 1.8 volts to 3.2 volts. This is different from standard diodes which have a voltage drop of around .6 volts. The common input voltage for breadboards ranges from 3 volts to 9 volts. If the resistor is larger than 350 ohms it should limit the current to less than 20 milliamps. The max current rating for LEDs is typically 20-25 milliamps. Common colors for LEDs are red, yellow, white, blue, and green.

Transistors

transistors for breadboards

Buy from Amazon

BJT transistors have three pins that are designed to work with breadboards. The three pins are the emitter, base, and collector. Which pin is which will vary depending on if it is an NPN or PNP transistor. The most common transistor used with breadboards is the 2N2222 NPN transistor. This is an amplifying transistor and also works as a switching transistor. I have used these to build digital logic gates. Like LEDs, transistors should also have a current-limiting resistor to prevent damage.

transistors kit with many types of BJT transistors

Buy from Amazon

Transistors often come in large sets where the are many types of NPN and PNP transistors. The most common NPN transistors are the 2N2222 and the 2N3904. For PNP transistors the most common are the 2N2907 which is equivalent to the 2N222 and the 2N3906 which is equivalent to the 2N3904. Each transistor does have different specifications so using the proper model number is important.

Capacitors

capacitor kit

Buy from Amazon

The three types of capacitors used with breadboards are ceramic capacitors, aluminum electrolytic capacitors, and metalized polypropylene capacitors which are also called film capacitors. In the photo above is a set of ceramic capacitors. These have a capacitive range from 0.1 µF to 10 µF. Ceramic capacitors are non-polarized meaning the orientation of the capacitor is not important. Electrolytic capacitors are polarized meaning one terminal must be connected to the positive voltage and the other side must be connected to the ground side. If this is done in reverse the capacitor will quickly heat up and break, often resulting in a popping noise and the smell of melting capacitor material. Most film capacitors are not polarized. Breadboard capacitors can range in size from 10 pF to 10,000 µF.

Integrated Circuits

integrated circuit on a breadboard

Buy from Amazon

Breadboards are also designed to work with integrated circuits. An entire microprocessor can be placed on an integrated circuit so ICs drastically increase the potential of what can be done on a breadboard. Common integrated circuits to use on breadboards include logic gates, 555 timers, op-amps, shift registers, EPROM, FPGAs, gyroscopes, and microprocessors.

BreadBoard Tools

Wire Stripper

wire stripper tool

Buy from Amazon

Wire strippers are needed to cut wires and remove the wire insulation on the end of the wire. Breadboard wires are 22 gauge so the stripper needs to have a slot to strip 22 gauge wire insulation. The wire stripper above can cut and strip wire from 10 gauge to 22 gauge. It also has a crimper to make crimp connections. When cutting breadboard wire to exact lengths some type of cutter and wire stripper is needed.

Wire Cutter

scissors to cut wire

Buy from Amazon

Scissors or a wire cutter make cutting wire much easier. The wire stripper tool does have a cutter but only on the back of the jaws. Having a tool with a cutter on the front jaws makes it easier to mark where the wire needs to be cut. Resistor wire is very thin and is easy to cut with scissors. I often cut multiple resistor wires down to the proper size with just one cut on each side. A small wire cutter is probably best but scissors do work if that is what is available.

Breadboard Power Supply

A breadboard can be powered by a variety of power supplies. Batteries used to be the most common way to power a breadboard. Two 1.5-volt batteries in series make a 3-volt power source. Three 1.5-volt batteries in series can be used to supply 4.5 volts. One 9-volt battery works with connector clips and power wires. There are also breadboard power supply modules that can provide 3.3V or 5 volts. The module can receive input power through a 2.1 mm jack plug or USB cable. The disadvantage of the breadboard module is that it takes up space on the breadboard. Power can also be sent from an Arduino, Raspberry Pi, or microcontroller to the breadboard.

USB Battery Pack

external 5 volt batter pack and USB connector for breadboard

Buy from Amazon

In the photo above I am providing power to a 4-bit calculator that is built on breadboards using a 5-volt battery pack. I modified a USB power cable so that it could go into the positive and negative terminals of the breadboard. This was done by splicing solid core 22 gauge wire from the stranded cable that was in the original power cable. The only downside to using this battery pack is it does have an auto shut-off feature if the output current is too low. It stops supply power after about 30 seconds when this is the case. Pushing the button on the battery pack will allow the current to flow for another 30 seconds. This is ok when testing circuits because you typically know within 30 seconds if the circuit is working properly. For larger circuits, it will not shut off as the current used is high enough to not shut the power off.

Cell Phone Charge and USB Cable

USB power cable for a breadboard

Using a 5-volt cell phone charger is becoming a popular way to power a breadboard. Most cell phone chargers and USB ports from computers provide a 5-volt power source. In the photo above I modified a 6-foot USB cable to have breadboard jumper cable ends. Now, most USB power supplies will work to power the breadboard at 5 volts.

External Circuit With USB Power Supply

breadboard 3 volt and 5 volt power supply with USB battery pack

The photo above shows how to connect power to a breadboard power supply module using a USB cable. A 5-volt battery pack is supplying the power. The module receives power from the USB cable. Jumpers above each power rail can be moved so that 5 volts, zero volts, or 3.3 volts is supplied to the power rail. The top and bottom power rails can be set to different values. In the photo, the top power rail is set to 5 volts and the bottom power rail is set to zero volts. A green LED on the board indicated the power is being supplied to the board. There is a button that turns the power off to the board and the LED will shut off when power is not being supplied to the breadboard.

Power Supply Module

breadboard power supply module with USB cable

Buy from Amazon

The close-up view of the power supply modules shows all the features of the board. Input power can come from the jack plug or USB cable. Power going into the power jack needs to be between 6.5 and 9 volts. Power coming from the USB should be around 5 volts. The module is connected to the breadboard with 8 pins. Four pins on each side go into the power rails. This is an ok option to power a breadboard. I personally prefer when power is supplied over two wires. It makes it so there is more room on the breadboard and makes the breadboard less cluttered. When making demonstration videos it is also nice not having people wonder what is going on with the power supply. It is simpler to just show a red wire and a black wire going into the positive and negative slots in the breadboard.

digital multimeter

Buy from Amazon

A multimeter provides a way of measuring the current in the circuit. It is also a way to measure the voltage levels within the circuit. I do use this multimeter to determine the current. For voltage levels though, I prefer to see the output on the oscilloscope as this provides transient information as well.

Siglent digital oscilloscope1

Buy from Amazon

Having a digital oscilloscope is really handy when working with circuits. It is often difficult to know what is going on within the circuit without looking at the voltage values at different locations within the circuit. The oscilloscope not only shows the voltage values but shows the values over time so you can see transient conditions within the circuit.

4-Bit Calculator Built Using Digital Logic Gates

Building a 4-bit calculator using individual transistors helps demonstrate how computers add numbers. This can be thought of as a  simple arithmetic logic unit (ALU) for a computer. In this case, the calculator is a stand-alone device that can add two 4-bit inputs together. In binary, the highest 4-bit input is 15 which is 1111 in binary. There is also a carry-in slot in the first full adder so the calculator can add 15+15+1 for a max value of 31 which is 11111 in binary.

4 bit calculator built using transistor logic gates

The photo above shows the 4-bit calculator I built on four breadboards. Two 4-slot dip switches control whether the inputs are on or off. When an input is on the dip switch will be in the up position and the LED above the dip switch will be on. When an input is off the dip switch will be in the down position and the LED above the dip switch will be off. The output is represented by the 5 LED lights on the right-hand side of the breadboard. The position of the LED determines its value. When the top LED is on it represents 1, the second LED represents 2, the third LED represents 4, the fourth LED represents 8, and the fifth LED represents 16. If all 5 LEDs are on it is 11111 in binary which is 15 in the base 10 number system.

4-Bit Calculators

4 bit calculators built on breadboards

In this article, I am going to show two different ways to build a 4-bit calculator. The first is going to use 4 full adders that are all built the same way. Next, I am going to show how to use 4 full adders which are all built differently to build a second 4-bit calculator. This will help demonstrate that there are multiple ways to design digital logic gate circuits that perform the same operation. Building a 4-bit calculator would be a fun circuit science project for someone looking to further their understanding of digital logic gates. I plan to take the first 4-bit calculator and used it as an ALU for a 4-bit computer that is built with individual transistors.

The video above shows how to build the first 4-bit calculator using individual transistors. It also explains the binary number system to describe how the calculator adds in base 2. At the end of the video the calculator is tested by varying the two 4-bit inputs and it works as expected. The calculator is powered by a 5-volt battery pack that is typically used to charge cell phones.

4-Bit Calculator Built with Individual Transistors

4 bit calculator buit with individual transitors

The first 4-bit calculator is shown above. There are four breadboards that are connected together. Each breadboard has one full adder. The first full adder also has dip switches to turn the inputs on or off. All of the resistor values used are 2K.  On the left side of the calculator red wires run from the top positive 5-volt rail to inputs A and B of each full adder. The carry-out of full adder 1, full adder 2, and full adder 3 feed into the carry-in location in the next full adder. On the right-hand side, red and black wires connect power to each breadboard. The main power is supplied to the top breadboard from the two wires on the top right-hand side of the calculator. All of the transistors used are NPN type with a model number of 2N2222, and model number 2N3904 will also work as these have very similar properties.

In the photo the first 4 inputs are on, the second 4 inputs are on and the carry-in is off. This means that 1111 + 1111 + 0 is what is being added. The output should therefore equal 30 which is 11110 in binary. If you look at a calculator you can see that the LED lights show an output of 11110 as expected.

Logic Gate Level Circut Diagram

4 bit calculator digital logic gate level circuit diagram using xor gates

The logic gate-level circuit diagram is shown above. Each full adder is built with 2 XOR gates, 2 AND gates, and an OR gate. The inputs are in the top left corner of the circuit while the outputs are on the right-hand side of each full adder. Inputs are labeled based on their value for example input 4A has a value of 4 based on its position in the circuit. This diagram provides a high-level design of how the 4-bit calculator should be built. It does not however detail how each logic gate is to be built.

Component Level Circut Diagram

4 bit calculator transistor level circuit diagram using xor gates

The component-level circuit diagram for the 4-bit calculator is shown above. This shows how each logic gate is to be wired using individual transistors. Each full adder is built the same way. So once it is understood how to build one full adder it is not difficult to wire four of them together to form the adder circuit. In each full adder, the first 6 transistors are the first XOR gate, and the next 5 transistors are the second XOR gate. The second XOR gate does not send an output so one less transistor is needed. In the bottom row of each full adder, the first three transistors are the first AND gate, the next three are the second AND gate. Finally, the last three transistors are the OR gate.

All resistor values are labeled 1K except the input resistors which are 470 ohms. The input resistors are lower because the inputs have a 1.9-volt voltage drop across the input LEDs being used to show if the input is on or off. The carry-in on the first full adder is turned on by connecting the second input of the second AND gate to the 5-volt rail. This is done by adding a resistor to the carry-in location.

4-Bit Calculator Built with Different Types of Logic Gates

4 bit calculator with logic gate circuit diagrams

The four-bit calculator above is built by wiring four full adders together. Each full adder is implemented in a different way. The first two full adders use the same logic gate design. However, the top full adder uses integrated circuits while the second full adder uses individual transistors. The third full adder uses 9 NAND gates that are built with individual transistors. Finally, the fourth full adder is built with 9 NOR gates that are built with individual transistors.

In the video, I explain how to build this second 4-bit calculator. I also do a demonstration of the calculator working by adding several numbers.

4-bit calculator built with four different types of full adders

The 4-bit calculator above is made with many different types of logic gates and components. One of the great things about digital logic is there are many ways to build a circuit that will provide the same output values. The circuit is placed next to the circuit diagram to help if you plan to build this calculator as a project.  Right now the circuit has the first four inputs on, the second four inputs on, and the first full adder has the carry-in on. This makes the addition 1111 + 1111 + 1 which is 31. The output is 11111 which is 31 in binary which is what the output of the calculator provided.

Logic Gate Level Circut Diagram

4 bit calculator digital logic gate level circuit diagram using xor gates nand gates and nor gates

The logic gate-level circuit diagram for the 4-bit calculator is provided above. This makes it clear which types of logic gates are to be used. However, it does not provide any insight into how each logic gate should be built. The top two full adders have the same logic gate design. Integrated circuits are used for the logic gates in the first full adder while individual BJT transistors are used to build the logic gates in the second full adder. The third full adder is made with NAND gates and the fourth full adder is made with NOR gates. Each NAND and NOR gate can be built with two transistors.

Component Level Circut Diagram

4 bit calculator component level circuit diagram using transistors and integrated circuits

The circuit diagram above provides a detailed depiction of where every connection should be made to build the 4-bit calculator. Each full adder is built differently but the input and outputs are equal. This is an interesting way to build a 4-bit calculator cause it also demonstrates how to build six types of logic gates and shows how to implement integrated circuits. It takes around 20 hours of work to build a 4-bit calculator using individual transistors. This is because it is time-consuming to place all the components and cut the wires to the correct size. If you do build one of these calculators it is a useful way to teach others how logic gates work and how the ALU in a computer functions.

Now that you understand how to build a 4-bit calculator. Check out the video above where I build a 4-bit computer on breadboards. The ALU merged the two calculators above and added in XOR gates to allow subtraction using the 2’s complement method.

Leave a Comment