Книга: Introduction to Microprocessors and Microcontrollers

AND gate

AND gate

Unlike the NOT gate, an AND gate has more than one input. In fact we can have as many inputs as we like but the good news is that in microprocessors only two inputs are used. This simplifies the symbols and the truth tables considerably.

An AND gate is any circuit that gives a logic (or binary) 1 if (and only if) every input to the circuit is at logic 1. So in microprocessors, with only two inputs, it is easier to say that it gives a 1 out if both of the inputs is at logic 1. The symbols for the AND gate are shown in Figure 5.4.


Figure 5.4 Symbols for an AND gate

The truth table in Figure 5.5 has four rows to cover all the possible combinations of inputs.


Figure 5.5 The truth table for an AND gate

What is the point of an AND gate?

We often meet an AND gate without realizing it. When we climb into an elevator the door must be closed AND the floor button pressed before the motor will start. This is an AND gate in action. In a microprocessor, groups of AND gates are used to handle pairs of inputs at the same time just like we did with the NOT gates. For convenience we usually use hex numbers to describe groups of inputs and outputs but remember it’s all really happening in binary.

Unless we appreciate that the hex numbers are really just groups of ones and zeros, it may seem odd to talk about putting numbers through AND gates. Figure 5.6 may make it (a little) clearer. In this figure, we have used hex inputs of 37H and 5BH giving a result of 13H. Note that the AND gate does not add numbers.


Figure 5.6 An AND gate in action

A little extra bit

In data books and manuals, the AND function is abbreviated to a dot like a period (full-stop). So, if an AND gate had two inputs called A and B and an output called X, then we could write X = A·B

Sometimes it is further simplified to X = AB

Very occasionally we come across a symbol ? so we can write X=A?B.

Оглавление книги


Генерация: 0.546. Запросов К БД/Cache: 2 / 0
поделиться
Вверх Вниз