What is digital logic and what is a digital AND gate?

Maybe you wonder what is digital logic or a digital AND gate. Another name for digital logic is binary or boolean logic. A digital AND gate is a digital circuit performing a simple electronic function.

Most electronic devices like a calculator, television, a computer or mp3-player contain chips (also called integrated circuits or i.c.). In these chips fundamental digital elements (like AND-, NAND- and OR-gates) work together in order to accomplish certain functions, like calculating a multiplication, changing a television channel, etc. These gates are made of silicium. Silicium is a commonly used semi-conductor for making chips.

The way that certain digital elements work is descibed as digital logic. A digital AND gate works differently from a digital NAND gate for example. Digital logic is based on two states: 0 and 1. The 0-state is also referred as the 'off-state' and the 1-state is also referred as the 'on-state'. Normally, the 0-state corresponds to a signal of 0 volts and the 1-state commonly corresponds to a signal of 5 volts.

Digital electronic devices make use of the binary number system, because these devices can't work with decimal numbers like humans do.

In the picture below you see the symbols and names of the most common digital gates. All gates in this example (except the buffer- and not-gates) have two inputs on the left and one output at the right of the symbol. The buffer- and not-gates only have one input and one output. How the output of the gates respond to the signals at its inputs is written below the picture.

By the way, also gates exists with more than two inputs.

For example, both inputs of the digital AND gate must have a 1 at both of its inputs and only then the output will become 1. In all other cases the output of the digital AND gate remains 0.

A BUFFER-gate only amplifies its input signal, so when there's a 0 on its input, it's output also remains 0, likewise when there's a 1 at its input it remains 1 at its output. The NOT-gate inverts the signal at its input, so a 0 on its input becomes a 1 on its output and a 1 on its input becomes a 0 on its output.

logic gates

AND-gate
Input 1 Input 2 Output
0 0 0
0 1 0
1 0 0
1 1 1
NAND-gate
Input 1 Input 2 Output
0 0 1
0 1 1
1 0 1
1 1 0
OR-gate
Input 1 Input 2 Output
0 0 0
0 1 1
1 0 1
1 1 1
NOR-gate
Input 1 Input 2 Output
0 0 1
0 1 0
1 0 0
1 1 0
XOR-gate
Input 1 Input 2 Output
0 0 0
0 1 1
1 0 1
1 1 0
XNOR-gate
Input 1 Input 2 Output
0 0 1
0 1 0
1 0 0
1 1 1

By the way, in case you like to make electronic circuit drawings you can install TinyCAD on your computer. This is an open source (free) circuit drawing tool. Above picture was also made using this tool.

In case you want to learn about digital logic for your study or for fun, it's a great way to get started with this simulator or read this tutorial.

The simulator can be downloaded from the following site:

http://ozark.hendrix.edu/~burch/logisim/

In the next video you learn how to build, simulate and test your first digital logic circuit using Logisim. In the video is talked about a truth-table. This is simply a table in which is defined what the states (or voltage) of the inputs is and how the circuit responds to these input signal by setting the output on the desired state.

In the video an example is given for a circuit with 3 input signals and 1 output signal.

Let's make a binary adder

Now that you know some more, we can make a simple binary adder. In the picture below you see how this is accomplished in Logisim. We have put an XOR-gate (exclusive or) and a AND gate and created two inputs and two outputs. Probably by now you already know that an XOR-gate produces a 1 at it's output when only one of the inputs is 1, in all other cases it's output is 0. The AND-gate only produces a 1 at it's output when all it's inputs are 1.

Adding two single digit binary numbers is a very simple arithmetic operation:

0 + 0 → 0
0 + 1 → 1
1 + 0 → 1
1 + 1 → 0 and a carry bit of 1. In fact the result of this addition is 10 in the binary number system.

By the way, binary 10 is also the same as the number 2 in our decimal number system.

logical add

When you run the simulation by pressing the finger symbol in Logisim, you will see that when you click on the inputs of the adder that the sum and carry outputs change. When both inputs are 1, you will see that the sum output is 0 and the carry output is 1. In case you don't understand what a carry bit is or want to know more about binary numbers, you will learn more here.

Please refer to the help of Logisim for more information about using Logisim and understanding digital logic. Digital logic is fun. Once you understand the basics you are well on your way making your first real electronic digital device without using this simulator. It's not that hard once you know the basics. Off course then you need to have the right power supply, the right chips, a soldering station, a circuit board and maybe some LED's (light emitting diodes), so you can test your device.

 

Learn processor programming on a 8086 processor with assembly language

A computer processor or CPU (central processing unit) contains digital logic. Some of its basic components include registers (including an accumulator, stack pointer, program counter, instruction register), an arithmetic logic unit (ALU), an address and data buses, a control unit and an instruction or prefetch input queue. The 8086 processor from Intel is the processor that was being used on the first personal computers. Modern day personal computers still contain logic of the 8086 processor. The Space Shuttle also used the 8086 processor.

Assembly language is a human readable language that is used to give instructions to a processor. A processor however can't understand assembly language, so the instructions first have to be compiled to binary data (containing only 0 and 1 bits) that the processor can understand. An assembly compiler takes care of this conversion. Assembly language was invented in order to make it easier for humans to give instructions to a processor.

The 8086 emulator

The easiest way to learn assembly language is by installing a 8086 processor emulator on your computer. This piece of software gives insight into the inner working of the 8086 processor. You can write a piece of assembly language in this emulator an see what happens in the processor when you execute your program. On the site where you download the emulator also a good tutorial to learn assembly language and example assembly sourcecode is available. All free of charge. By the way, an emulator is not the same as a compiler. An emulator is more of a teaching / learning tool to help you better understand what happens when you execute an assembly program.

Below is a screenshot of the 8086 emulator.

emu8086

The 8086 compiler

Once you understand the basics of assembly language using the 8086 emulator, you should try using an assembler or assembly compiler. An assembler is a piece of software that compiles (or converts) the assembly instructions that you write in an assembly sourcefile into an executable program. This executable program can be run on your PC without using the the compiler or an emulator. By the way, an assembly sourcefile is just an ordinary textfile and it's common practice to give these sourcefiles the .asm filename extension instead of .txt.

Flat assembler is an open source (free) assembly language compiler for the 8086 based 32 en 64 bit processors.

Below you can watch a video explaining how to use flat assembler and how you can write your assembly programs.

In case you have questions about what is digital logic or processor programming with assembly language or using the simulators or compiler, please contact me.

What is digital logic • Digital AND gate