Professional Documents
Culture Documents
Digital Notes - 1
Digital Notes - 1
ELECTRONICS
YEAR 1
Sounds produced by the human voice and by musical instruments vary continuously
in both Amplitude and Frequency. They are said to be Analogue Signals. Analogue
signals include waveforms such as Sinosoidal and Triangular waveforms. Voltage in
these waveforms varies in a continuous manner with respect to time as shown below:
Examples of Analogue devices which we see in our every day life are the
Speedometer and the Petrol Gauge found in the dashboard of a car. They both give an
indication that varies continuously.
The Amplitude of a Digital Signal does not vary continuously. The amplitude of a
digital signal will suddenly change from one value to another and it will never have
an undefined value. A Binary Digital System will only have either one of two values;
it may be either HIGH or it may be LOW. The use of these signals allows relatively
simple TWO-STATE devices to be employed. Examples of such devices may be a
lamp which is either glowing or not; a buzzer which is either producing an audible
sound or not; a switch which either completes or breaks a circuit; or a semiconductor
diode or transistor which is either conducting (turned ON) or is non-conducting
(turned OFF).
Numbering Systems:
Introduction:
The most common numbering system we use in everyday life is the DECIMAL, also
called the DENARY system. The name by which this system is called indicates that
the numbers have a base of 10. Every number consists of 0 to 9 units; 0 to 9 tens; 0 to
9 hundreds; 0 to 9 thousands; and so on.
3 x 1000 or 3 x 103
4 x 100 or 4 x 102
7 x 10 or 7 x 101
5 x 1 or 5 x 100
The Base or Radix of a number system can be another number instead of 10. This will
indicate a different numbering system from the Decimal or Denary one. For example:
This system is used in Digital Electronics since it has only two digits, one (1) or zero
(0). In Digital Electronics only two states of voltage are utilized. A High or a Low, a
Logic 1 or a Logic 0.
A Binary number is a series of ones and zeros. The First digit on the right hand side is
the one with the lowest value. It is called the Least Significant Bit (LSB) or Digit. The
last digit on the left hand side is the one with the largest value and is called the Most
Significant Bit (MSB) or Digit.
As we did in the Decimal system, we can break up a Binary Number, this time using
the Base or Radix 2 instead of 10:
1 x 23
1 x 22
0 x 21
1 x 20
The 2n for every digit forming the number is called the weight of the respective digit
in decimal form. See table below:
(MSB) (LSB)
27 2 6
2 5
24 3
2 22
21
20
128 64 32 16 8 4 2 1
Decimal to Binary:
There are two main methods for converting a decimal number to Binary:
Method (a):
Divide decimal number by 2, and continue to divide answers by 2 until you get a final
result of zero. Read remainders of every answer, starting from remainder of last
answer. The binary number you get is the conversion of the decimal number given.
(To convert to octal – divide by 8. For Hexadecimal – divide by 16. Always divide by
the base of the number into which you want to convert)
÷2 1375
Read the Remainders (Rem.)
÷2 687 Rem. 1 from Bottom to Top to get the
÷2 343 Rem. 1 equivalent Binary number.
÷2 171 Rem. 1
÷2 85 Rem. 1
÷2 42 Rem. 1
÷2 21 Rem. 0
÷2 10 Rem. 1
÷2 5 Rem. 0
÷2 2 Rem. 1
1375Decimal = 10101011111 Binary
÷2 1 Rem. 0
0 Rem. 1
1375 Decimal
(1024) (512) (256) (128) (64) (32) (16) (8) (4) (2) (1)
1 0 1 0 1 0 1 1 1 1 1 Binary
(i). Write down the decimal weights for every binary digit up to the weight next lower
to the decimal number to convert.
(ii). Subtract the next lower weight from the decimal number. Continue to subtract the
answer by its next lower decimal binary weight until you cannot subtract anymore or
you get a zero answer.
(ii). Write a 1 under every weight used in the subtractions, and a 0 under those
weights not used. The result is the conversion to Binary.
Question 1: Convert the following Decimal Numbers into Binary: 98, 157, 376, 8575.
Method 1:
You can convert from binary to decimal by reversing one method given
for going from decimal to binary. That is, let ans start at 0 and suppose
the binary number is 11010111. Then compute new values of ans as shown
ans * 2 + 1 =>ans
ans * 2 + 1 =>ans
ans * 2 + 0 =>ans
ans * 2 + 1 =>ans
ans * 2 + 0 =>ans
ans * 2 + 1 =>ans
ans * 2 + 1 =>ans
ans * 2 + 1 =>ans
0 1 0 1 0 1 0 1 1 1 1 1 2
(x2)+ (=) (=) (=) (=) (=) (=) (=) (=) (=) (=) (=)
(x2)+ (x2)+ (x2)+ (x2)+ (x2)+ (x2)+ (x2)+ (x2)+ (x2)+ (x2)+
1375 10
Write down a table with the binary number and over each digit write the weight 2n.
Add together the weights which are over the 1’s.
Question 2: Convert the following Binary numbers into decimal: 1101, 10111,
101101, 11001100.
To convert Decimal into Octal, we divide by eight and then we read the remainders
from the bottom to get the Octal equivalent. The same as we did in binary.
÷8 2004
÷8 250 Rem. 4
÷8 31 Rem. 2 2004Decimal = 3724 Octal
÷8 3 Rem. 7
÷8 0 Rem. 3
To convert from Binary to Octal, just divide the binary number into groups of 3 digits
each and do a conversion of every group from binary to decimal.
0 1 1 1 1 1 0 1 0 1 0 02
3 7 2 48
To convert from octal to Binary, every digit in the octal number is converted into a 3
–bit binary number.
Computer systems use address and data buses that carry digital data in groups of 4
binary bits, or multiples of 4, such as 8, 16, and 32. Because of this it is generally
more useful to employ the 4-bit Hexadecimal Numbering System which has a Base
of 16. Since groups of 4 bits are employed the hexadecimal system provides values
from 0 through 15. Numbers higher than 9 are indicated by letters A for 10, B for 11,
C for 12, ………., and F for 15. A hexadecimal number is usually indicated by a letter
H following the number (e.g. 1B H)
To convert Hexadecimal numbers into Binary and vice-versa, the same method for
octal will be used. The only difference is that every hexadecimal digit is represented
by a 4-digit (4-bit) binary number.
Binary weight
1375 Decimal
(1024) (512) (256) (128) (64) (32) (16) (8) (4) (2) (1)
1 0 1 0 1 0 1 1 1 1 1 Binary
5 5 FHexadecimal
Question 5:
Convert the following decimal numbers into binary and then convert each one into
Octal and Hexadecimal.
This is a 4-bit binary code representing decimal numbers 0 to 9. The binary code
representing units, tens, hundreds, etc. of a decimal number is separated into groups
of separate nibbles (4-bit binary numbers). The least significant nibble represents the
decimal units, the next the tens, etc. The lower nibble is counted from 0000 to 1001.
Following the 1001, the lower nibble is reset to 0000 and the tens nibble is set to
0001. Hence the result will be a Binary code directly representing a Decimal number.
9 8 10
1001 1000 BCD
Question 6:
(a). Convert the following Decimal numbers into BCD format: 75, 156, 2567, 10100
(b). Convert the following BCD numbers into Decimal format: 0001 1001, 1000
0111, 0010 0011 1000, 1000 0001 0010
A logic gate is a circuit that performs a logic function on a number of input Binary
(Digital) signals. One gate is the basic building block from which many different
kinds of logic circuits can be constructed. Signals at the inputs of the gate are either
HIGH or LOW. The output then gives another digital HIGH or LOW signal according
to the combinations of the inputs. The types of gates that will be considered in these
notes are: AND, OR, NOT, NAND, NOR, exclusive-OR (Ex-OR) and the exclusive-
NOR (Ex-NOR). Logic gates are represented with symbols. The mostly used are the
US or ANSI symbols, but nowadays there are also the IEC (BS3939) (International
Electro-technical Commission) symbols for Logic Gates. Both symbols will be
illustrated in these notes.
The table is used to define the logic functions of a gate. It lists all the possible
combinations of the input variables that can be applied. Every variable can only be at
either logic 1 or logic 0 voltage level. Under the Output column the table gives the
resulting output according to the input combination.
This is an algebraic equation representing the logic function of the logic gate or digital
circuit.
The variables A, B, C and D are the inputs of the digital circuit or gate. The variable Y
represent the output of the digital circuit or gate. The output of the circuit will attain a logic 0
or 1 state according to the logic 0 or 1 state of the input variables. If we have only 1 input
variable, the logic states possible that we can have in the input are a 1 or a 0 (a total 0f 2).
When we have more than one input however, we will have more input, since there must be a
combination of the inputs. So, how can we decide the number of combinations we can have at
the inputs?
When we have only 1 input, the possible number of different inputs is 2 (0 or 1). This result is
the same as if we have 21. We agree that the power is actually the number of input/s we have
on our gate or circuit. So we can say that if we have a number of n inputs, the number of input
combinations that we can apply to the gate or circuit is equal to 2n.
So for the equation considered above, we will have 24 input combinations, or 16 different
combinations of inputs.
(1). From the number of inputs you have, decide how many combinations there can be during
the operation of the circuit.
(3). Starting from the first input (column) on the left, fill in half of the rows with 0, and the
remaining half of the rows with 1.In the next input (column) to the right, there must be 4
groups of 0 and 1’s. In the following column, 8 groups, …… etc., until you end up with
alternating 0 and 1 under the last column of inputs. For a 4 input gate or circuit the table
becomes like this:
A B C D Y
0 0 0 0 X
0 0 0 1 X
0 0 1 0 X
0 0 1 1 X
0 1 0 0 X
0 1 0 1 X
0 1 1 0 X
0 1 1 1 X
1 0 0 0 X
1 0 0 1 X
1 0 1 0 X
1 0 1 1 X
1 1 0 0 X
1 1 0 1 X
1 1 1 0 X
1 1 1 1 X
For the time being disregard the value of the output Y. That is why we listed it as a
result ‘X’. It can be either 0 or 1, but all depends upon the circuit particular function.
We will be understanding this as from now onwards by first doing the logic gates, and
then wiring the gates together to form our first digital circuits.
A & Y
B
0 1 0 Y=A.B
1 0 0
1 1 1
The OR gate:
A >1 Y
B
Question 7: Draw the symbols for a 3-input AND Gate and then compile the truth
table and write the Boolean Expression for a 3-input AND Gate. Repeat question for a
3-input OR gate.
A 1 Y
input
The NOT gate is also called ‘INVERTER’. This is because the function of this gate is
to invert the input at the output. So if the input is at logic 1, the output will be at logic
0 and vice-versa.
Input Output The Boolean Expression for the NOT gate is:
A Y
Y=A
0 1
The bar over a symbol
1 0 means ‘NOT’ that
symbol – i.e. Not A
A & Y
B
The NAND gate does the same function as the AND gate, but the Output is inverted.
We can call this function as the ‘NOT AND function’.
The truth table for the NAND gate is:
0 1 1 Y=A.B
1 0 1
1 1 0
Hence the NAND gate can be constructed using an AND gate and a NOT gate in
series.
A >1 Y
B
The NOR gate does the same function as the OR gate, but the Output is inverted. We
can call this function as the ‘NOT OR function’.
0 1 0 Y=A+B
1 0 0
1 1 0
Hence the NOR gate can be constructed using an OR gate and a NOT gate in series.
Question 8: Compile a truth table for the circuit above to show that it does the same
function as the NOR gate.
In the Exclusive-OR gate, known also as EX-OR gate, has just two inputs and only
one Output. The Output is HIGH (logic 1) only when either one, but not both, of the
inputs is also HIGH. The symbols for the EX-OR gate are shown below
A =1 Y
B
Inputs Output
0 1 1 Y=A + B
1 0 1
1 1 0
This is also sometimes called as the ‘Coincidence’ gate. It produces a logic 1 level at
the output only when the two inputs are at the same level. The symbols and the truth
table for the EX-NOR gate are given below.
Exclusive-NOR Gate A =1 Y
B
Inputs Output
0 1 0 Y = A.B + A.B
1 0 0
1 1 1
Combinational logic circuits are composed of basic logic gates connected together to
form a new, more complex, logic function.
A
A+ B
B
Y = (A + B) . C
C C
Now write the truth table for the circuit above. Work out intermediate logic functions
first and then obtain the final output Y.
A B C A+B C Y=(A+B).C
0 0 0 0 1 0
0 0 1 0 0 0
0 1 0 1 1 1
0 1 1 1 0 0
1 0 0 1 1 1
1 0 1 1 0 0
1 1 0 1 1 1
1 1 1 1 0 0
Question 9: For the circuit shown below, produce the boolean expression of each
logic gate, and that of the circuit output. Produce the truth table of the circuit
A
B Y
Question 10: Analyze the circuit shown below. Write down the boolean expression of
the circuit and then produce the truth table. Use the truth table to determine the output
when (a) A = B = C = 1, and (b) A = C = 0 and B = 1. What is the logic function of
the circuit?
A
B
Y
A
B