Electronics Module by Sam Kinyera OBWOYA - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

Introduction

There are two basic types of circuits that may be considered as digital devices: Logic

Gates, and Flip-flop. Electronic calculator is an example of a digital circuits, where information is processed in binary form, and the output are displayed as decimal

numbers. The gradual turning of the potentiometer shaft is the analog input in a circuit

consisting of a battery, potentiometer and ammeter all in series.

Examples of analog signals include: sine wave, audio and video signals, while the

square wave is an example of a digital signal. A digital signal has two distinct am-

plitudes such as 0 and +5 V. The pulse is either all on or all off i.e. High or Low.

Activity 4.1

Number Systems

(i) Manipulation of numbers in different bases

A number system is a set of numbers, together with one or more operations, such as

addition or multiplication.

Examples of number systems include: natural numbers, integers, rational numbers,

algebraic numbers, real numbers, complex numbers, p-adic numbers, surreal num-

bers, and hyperreal numbers.

Numeral

The numerals used when writing numbers with digits or symbols can be divided into

two types that might be called the arithmetic numerals 0,1,2,3,4,5,6,7,8,9 and the

geometric numerals 1,10,100,1000,10000... respectively.

There are four systems of arithmetic numerals which are often used in digital circuits.

These systems are:

1. Decimal; it has a base (or radix) of 10 i.e. it uses 10 different symbols to

represent numbers.

2. Binary; it has a base of two i.e. it uses only two different symbols.

3. Octal; it has a base of 8 i.e. it uses eight different symbols.

4. Hexadecimal; it has a base of 16, i.e. it uses sixteen different symbols.

index-81_1.jpg

African Virtual University 0

All these systems use the same type of positional notation except that

a) decimal system which uses powers of 10 are used to represent quantities which

are outside the digital system.

b) binary system which uses power of 2, is extensively used by digital systems

like digital computers which operate on binary information.

c) octal system which uses power of 8, has certain advantages in digital work

because it requires less circuitry to get information into and out of a digital

system. Moreover, it is easier to read, record and print out octal numbers than

binary numbers.

d) hexadecimal system which uses power of 16 is particularly suited for micro-

computers

Activity 4.2

The decimal Number System

(i) Base or Radix

The decimal number system has a base of 10 meaning that it contains ten unique

symbols (or digits). These are: 0,1,2,3,4,5,6,7,8,9. Any one of these may be used in

each position of the number.

(ii) Position Value

Position value of a number 2573 given by:

2573 = 2*103 + 5*102 + 7*101 + 3*100

The number, 3 is the least significant digit (LSD) whereas 2 is the most significant

digit (MSD).

Again, the number 2573.469 can be written as

2573.469 = 2*103 +5*102 + 7*101 +3*100 +4*10-1 +6*10-2 +9*10-3

index-82_1.jpg

African Virtual University

Activity 4.3

Binary Number System

Like decimal number (or denary) system, it has a radix and it also uses the same type

of position value system.

Radix

Its base or radix is two because it uses only two digits 0 and 1 (the word ‘binary digit’

is contracted to bit). All binary numbers consist of a string of 0s and 1s. Examples

are 10, 101, and 1011 which are read as one-zero, one-zero-one and one-zero-one-

one. To avoid confusion subscripts of 10 for decimal and of 2 for binary are added

as shown below.

10 , 101 , 6574 ___ decimal number and

10

10

10

10 , 101 , 110001 ____ binary numbers.

2

2

2

Position Value

The position value of each bit corresponds to some power of 2. A 7-bit binary number

1101.011 is as illustrated below

MSD

LSD

1

1

0

1

0

1

1

23

22

21

20

2−1

2−2

2−3

Binary Point

The decimal equivalent is

1101.011 = 1× 23

(

)+ 1× 22

(

)+ 0× 21

(

)+ 1× 20

(

)+ 0× 2−1

(

)+ 1× 2−2

(

)+ 1× 2−3

(

)

2

1 1

= 8 + 4 + 0 + 1+ 0 + = 8 + 4 + 0 + 1+ 0 + + = 13.375

2 8

10

Binary numbers are used extensively by all digital systems primarily due to the nature

of electronics itself. The bit 1 may be represented by a saturated (fully-conducting)

transistor, a light turned ON, a relay energised or a magnet magnetized in a particular

direction. The bit 0, on the other hand, can be represented as a cut-off transistor, a light

turned OFF, a relay de-energised or a magnet magnetised in the opposite direction.

In such cases, there are only two values which a device can assume.

index-83_1.jpg

African Virtual University

Activity 4.4

Binary to Decimal Conversion

The following procedures should be adopted for converting a given binary integer

(whole number) into its equivalent decimal number:

Step 1. Write the binary number i.e. all its bits in a row.

Step 2. Directly under the bits, write 1, 2, 4, 8, 16, …Starting from right to left.

Step 3. Cross out the decimal weights which lie under the0 bits.

Step 4. Add the remaining weights to get the decimal equivalent.

Example 4.1 Convert 1101 to its equivalent decimal number

2

Solution The four steps involved in the conversion are given as follow.

Step 1.

1

1

0

0

1

Step 2

16

8

4

2

1

Step 3

16

8

4

2

1

Step 4

16+8+1 = 25.

∴1101 = 25

2

10

Activity 4.5

Binary Fractions

The procedure is the same as binary integers except that the following weights are

used for different bit positions.

Example 4.2. Convert the binary fraction 0.101 into its decimal equivalent.

Solution. The following four steps will be used for this purpose.

Step 1.

0

1

0

1

Step 2.

½

¼

1/8

Step 3.

½

¼

1/8

Step 4.

½ +1/8 = 0.625

∴0.101 = 0.625

2

10

Example 4.3 Find the decimal equivalent of the 6-bit binary number 101.101 2

Solution

1

0

1

1

0

1

4

2

1

½

¼

1/8

4

2

1

½

¼

1/8

= 5 + ½ +1/8 = 5.625

∴101.101 = 5.625

2

10

index-84_1.jpg

African Virtual University

Activity 4.6

Double-Dadd Method

This method of converting binary integers into decimal equivalents is much simpler

and quicker than the method so far given especially in the case of large numbers.

The three steps are involved:

1. Double the first bit to the extreme left and add this doubled value to the next

bit on the right.

2. Double the sum obtained and add the doubled value to the next bit.

3. Continue step 2 until the last bit has been added to the previously-doubled

sum.

The conversion of 11001 is as follows. It is seen that 11001 =25

2

2

10

1

1

0 0

1

2 × 1 = 2,2 + 1 = 3, 2 × 3 = 6,6 + 0 = 6, 2 × 6 = 12,12 + 0 = 12, 2 × 12 = 24,24 + 1 = 25

(i)Using double-dadd method, let us convert

into its binary equivalent.

1110102

1. 2 × 1 = 2 ,

add next bit 1 so that 2+1 =3

2. 2 × 3 = 6 ,

add next bit 1 so that 6+1 =7

3. 2 × 7 = 14 ,

add next bit 0 so that 14+0 =14

4. 2 × 14 = 28,

add next bit 1 so that 28+1 =29

5. 2 × 29 = 58 ,

add next bit 0 so that 58+0 =58

Therefore 111010 = 58 .

2

10

index-85_1.jpg

African Virtual University

4.7

Decimal to Binary Conversion

(a) Integers

Such conversions can be achieved by using the so-called double-dadded method.

Or by divide-by-two methods. As an example, let us convert 25 into its binary

10

equivalent.

25 ÷ 2 =12+ remainder of 1

TOP

12 ÷ 2 = 6 + remainder of 0

6 ÷ 2 = 3 + remainder of 0

3 ÷ 2 = 1 + remainder of 1

1 ÷ 2 = 0 + remainder of 1

BOTTOM

Therefore

25 = 11001

10

2

(b) Fractions

In this case, Multiply-by-two rule is used we multiply each bit by 2 and record the

carry in the integer position.. The steps below shows how 0.8125 is converted into

10

its binary equivalent.

0.8125 × 2 = 1.625 = 0.625

with a carry of 1

0.625 × 2 = 1.25

= 0.25

with a carry of 1

0.25 × 2 = 0.5

= 0.5

with a carry of 0

0.5 × 2 = 1.5

= 0.0

with a carry of 1

∴0.8125 = 0.1101

10

2

Activity 4.9

Binary Operations

The following four binary operations are considered:

1. addition

2. subtraction

3. multiplication

4. division

(a) Use your school knowledge of mathematics to carry out binary addition.

(b)

Binary subtraction.

Binary subtraction requires more borrowing operations than decimal subtrac-

tionThe four rules for binary subtraction are provided as follows:

1. 0 – 0 = 0,

2. 1 - 0 = 1,

3. 1 – 1 = 0,

4. 0 – 1 = 1 with a borrow of 1 from the next column of the minuend

or 10 – 1 = 1

index-86_1.jpg

African Virtual University

Example 4.4

Let us subtract 0101 from 1110 . The various steps are explained below:

2

2

1110

-0101

1001

Explanation

1. In the first column, since we can not subtract 1 from 0, we borrow 1 from the

next column to the left. Hence, we put down 1 in the answer and change the

1 of the next left column to a 0.

2. We apply Rule 1 to the next column i.e. 0 – 0 = 0.

3. We apply Rule 3 to the third column i.e. 1 – 1 = 0.

4. Finally, we apply Rule 2 to the last i.e. fourth column it. 1 – 0 = 1

As a check, it may be noted that talking in terms of decimal numbers, we have sub-

tracted 5 from 14. Obviously, the answer has to be 9 (1001 ).

2

Activity 4.10

Complement of a Number.

In digital work, two types of compliments of binary number are used for comple-

mental subtraction:

(a) 1’s complement

The 1’s complement of a binary number is obtained by changing its each 0

into a 1 and each 1 into a 0. It is also called radix-minus-one-complement.

For example, 1’s complement of 100 is 011 and of 1110 is 0001 .

2

2

2

2

(b) 2’s complement

The 2’s complement of a binary number is obtained by adding 1 to its 1’s

complement.

2’s complement = 1’s complement + 1

This is also known as true complement.

Example: 4.5

The 2’s complement of 1011 is found as follows:

2

Step 1: Its 1’s complement is 0100

2 .

Step 2: Add 1 to 0100 in order to get 0101 .

2

2

Step 3: Thus, 2’s complement of 1011 is 0101 .

2

2

index-87_1.jpg

African Virtual University

The complement method of subtraction reduces subtraction to an addition process.

In digital computers this method is popular because

1. Only adder circuits are needed thus simplifying the circuitry.

2. It is easy with digital circuits to get the complements.

Activity 4.10

1’s Complemental Subtraction.

Subtracting of a number is done by adding its 1’s complement to the minuend, using

the following rules:

1. Compute the 1’s complement of the subtrahend by changing all its 1 to 0

s

s

and all its 0 to 1 .

s

s.

2. Add this complement to the minuend.

3. Perform the end-around carry of the last 1 or 0.

4. If there is no end-around carry (i.e. 0 carry), then the answer must be recom-

plemented and a negative sign attached to it.

5. No recomplementing is necessary if the end-around carry is 1.

Example 4.6

Subtracting 101 from 111 is performed as follows:

2

2

Solution

111

+ 010 ← 1’s complement of subtrahend 101

1001

1 ← end-round carry

010

The final answer is obtained by removing from the addition sum carry in the last

position and added it onto the remainder. This is called end-round carry.

index-88_1.jpg

African Virtual University

Task 4.1 Using the rules stated under 4.13 in solving problems

Use the rules for subtraction and carry out the following subtractions.

a. Subtract 1101 from 1010 . The final answer is -0011. Explain how this is

2

2

obtained.

b. Subtract 1110 from 0110 . The answer is -000 .

2

2

2

c. Subtract 01101 from 11011 . The answer is 00 .

2

2

2

Activity 4.11

2’s Complemental Subtraction

The essential steps are given as follows:

1. Find the 2’s complement of the subtrahend,

2. Add this complement to the minuend,

3. Drop the final carry,

4. If the carry is 1, the answer is positive and needs no recomplementing,

5. Recomplement the answer and attach minus sign if there is no carry.

Example 4.7 Using 2’s complemental subtraction

Subtract 1010 from 1101

2

2

Solution.

The 1’s complement of 1010 is 0101

The 2’s complement is 0101 + 1 = 0110

Adding this to 1101 we get

1101

+0110

10011

Dropping the final carry gives the final answer as 0011 .2

index-89_1.jpg

African Virtual University

Activity 4.12

Binary Multiplication and Division

The procedure for multiplication and division are the same as for decimal multipli-

cation and division.

(a) The four simple rules for multiplication are:

i. 0 × 0 = 0

ii. 0 × 1 = 0

iii. 1 × 0 = 0

iv. 1 × 1 = 1

(b)Rules for division are:

i. 0 ÷1=0

ii. 1 ÷ 1= 1

iii. Division of 1 by 0 is meaningless

Task 4.2 Further Reading and note making

a) Use available references and read about multiplication and division of binary

numbers.

b) Do as many examples as possible in order to come to grip with such pro-

blems.

c) Multiply 1101 by 1100 (Answer is 1001100 ).

2

2

2

d) Multiply 111 by 111 (Answer is 101001 ).

2

2

e) Divide 11001 by 101 (Answer is 101 ).

2

2

2

f) Divide 110011 by 100 (Answer is 110.11 ).

2

2

2

Activity 4.13

Octal Number System.

(i) Radix or Base

It has a base of 8 which means that it has eight distinct counting digits:

0,1,2,3,4,5,6, and 7

index-90_1.jpg

African Virtual University

These digits 0 through 7 have exactly the same physical meaning as in decimal system.

Beyond 7, the counting becomes

0, 1,

2,

3,

4,

5,

6,

7,

→ 10, 11,

12,

13,

14,

15,

16,

17,

20, 21,

22,

23,

24,

25,

26,

27,

30, 31,

32,

(ii) Position value

The position value (or weight) for each digit is given by different powers of 8 as

shown below:

← 8 4

8 3

8 2

8 1

8 0

8 −1

8 −2

octal point

Example 4.8 Conversion of octal numbers to decimal

453

8 ≡ 4 × 82 + 5 × 81 + 3 × 80 = 4 × 64 + 5 × 8 + 3 × 1 = 29910

1

1

453.27 ≡ 4 × 82 + 5× 81 + 3× 80 = 4 × 64 + 5× 8 + 3×1+ 2 × + 7 ×

8

8

64

; 299.359410

Example 4.9 Conversion of decimal numbers to octal

Here 8 acts as a multiplying factor for integers and as a dividing factor for frac-

tions.

256 .43 → octal

10

256 ÷ 8 = 32

with 0 remainder

32 ÷ 8 = 4

with 0 remainder

4 ÷ 8 = 0

with 4 remainder

⇒ 256 ≡ 400

10

8

Similarly,

index-91_1.jpg

African Virtual University 0

0.43 → octal is worked out as follows

10

0.43 × 8 = 3.44 = 0.44

with a carry 3

0.44 × 8 = 3.52 = 0.52