0% found this document useful (0 votes)
4 views32 pages

Computer Number System

Chapter Three covers the basics of data, information, data processing, and data representation. It defines data as representations of objects or events, while information is processed data used for decision-making. The chapter also discusses data processing operations, information sources, and various numbering systems, including binary and hexadecimal, essential for digital computing.

Uploaded by

kehaly44
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views32 pages

Computer Number System

Chapter Three covers the basics of data, information, data processing, and data representation. It defines data as representations of objects or events, while information is processed data used for decision-making. The chapter also discusses data processing operations, information sources, and various numbering systems, including binary and hexadecimal, essential for digital computing.

Uploaded by

kehaly44
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

Chapter Three

Basics of information, Data, Data Processing and Data


Representation

Data and information


Data can be defined as any type of representation of an object or an event.
Representation could be in the form of number, text symbols, and voice, static or
dynamic image and so on.
Most data represent only a very small number of attributes of the object or the event in
question.
E.g. an individual (entity) object

Name Attributes Abebe


Age 19 Data
Sex Male

Information can be defined as a processed or summarized data for a particular analysis


or decision making. What are useful are both:-
 Specific to the task and
 The knowledge of analyst (decision maker)
We can also define as compiled or useful data for decision making.
For many task (information) useful data is observations of behaviors recorded as
numerical measurements, text, symbols, voice message or images. Such observation
enables the analyst to determine the current status of the observed behavior and to predict
future behavior.

1
Data Processing
Is the process of converting data in to information? The process usually assumed to be
automated and running on a personal computer (Generally information communication
technology). More generally the term data processing can apply to any process that
converts data form one formats to another ; for this perspectives , data processing
becomes the processes of converting data in to information and also the converting of
information back in to data.

Basics Operations of data processing


Data processing may be done manually, mechanically, electronically or a combination of
both. For our lesson we give emphasis on electronic data processing. The following are
the basic operations during data processing electronically.
1. Input refers capturing the information. During the operation data is entered or
otherwise capture electronically and is converted to a form that can be processed
by the electronic machine (computer).
2. Processing the data is manipulated (analyzed) to transform in to useful
information. During the operation useful actions like arithmetic operation, sorting,
classifying and summarization may made on the row data.
3. Output generating the processed data ( information) to the user using different
devices
4. Disseminating dispatching the information to the appropriate user through
communication Medias.
5. Storing accumulating the processed data for later use or processing.

Data processing
 Addition Disseminating
 Subtraction
Input  Division
Out put
Row data  multiplication
Processed data
 sorting (information
 expertise knowledge
 Classification etc...

Storing

Storing Storing
For later processing For later use 2
Information source
Information sources generally categorized in to two broad categories. These are
1. Documentary information sources: those information sources which we normally
obtain them either in paper printed format or electronically recorded format.
Documentary information sources again categorized in to three groups.
o Primary documentary information sources: - they are original material.
They are from the time period involved and have not been filtered through
interpretation. Examples of primary information sources are
 Diaries
 Interviews( legal proceedings, personal, telephone, e-mail)
 Letters
 Original document
 Patents
 Photographs
 Proceedings( meeting, Conference, and Symposia)
 Survey research
 Works of Literature
o Secondary sources: are accounts written after the fact with the benefit of
hindsight. They are interpretation and evaluations of primary sources.
Secondary sources are not evidence, but rather commentary on and discussion
of evidence. Examples of secondary information sources are
 Scholarly periodicals
 Books
 Text books
 Commentaries
 Monographs
o Tertiary information sources: consists of information which is a distillation
on collection of primary and secondary sources.
 Almanac
 Encyclopedias
 Fact books
 Indexes(used to locate primary and secondary information sources)

3
2. Non-documentary information sources. Those information sources which don’t
recorded in any format. E.g. public speech, informal talks with friends, discussion
group etc…
o Formal : an information sources from formal meetings , conferences
o Non formal: informal communication with friends, discussion group etc…

Data Representation and Numbering Systems

We know that the computer is an electronic device ie it works using electrical signals. Electrical
signals can represent only two states; on and off. (E.g. an electric bulb). So any information that
has to be processed by a digital computer has to be converted in to a format which has two states.
So in digital information processing we use the binary number system which has two digits.

The Binary Number System


Binary numbers all consist of combinations of the two digits '0' and '1'. These are some examples
of binary numbers: 1, 10,1010,11111011, and 11000000 10101000 00001100 01011101
Sometimes the binary numbering system called a base-two system because binary numbers only
contain two digits.
Number Base Conversion
Binary to Decimal
It is very easy to convert from a binary number to a decimal number. Just like the decimal system,
we multiply each digit by its weighted position, and add each of the weighted values together. For
example, the binary value 1100 1010 represents:
1x27 + 1x26 + 0x25 + 0x24 + 1x23 + 0x22 + 1x21 + 0x20 =1 x 128 + 1 x 64 + 0 x 32 + 0 x 16 + 1 x
8 + 0 x 4 + 1 x 2 + 0 x 1 =128 + 64 + 0 + 0 + 8 + 0 + 2 + 0 = 202
Decimal to Binary
To convert decimal to binary is slightly more difficult. There are two methods that may be used to
convert from decimal to binary, repeated division by 2, and repeated subtraction by the weighted
position value.
Repeated Division By 2
For this method, divide the decimal number by 2, if the remainder is 0, on the side write down a
0. If the remainder is 1, write down a 1. This process is continued by dividing the quotient by 2
and dropping the previous remainder until the quotient is 0. When performing the division, the
remainders which will represent the binary equivalent of the decimal number are written

4
beginning at the least significant digit (right) and each new digit is written to more significant
digit (the left) of the previous digit. Consider the number 2671.

Division Quotient Remainder Binary Number

2671 / 2 1335 1 1

1335 / 2 667 1 11

667 / 2 333 1 111

333 / 2 166 1 1111

166 / 2 83 0 0 1111

83 / 2 41 1 10 1111

41 / 2 20 1 110 1111

20 / 2 10 0 0110 1111

10 / 2 5 0 0 0110 1111

5/2 2 1 10 0110 1111

2/2 1 0 010 0110 1111

1/2 0 1 1010 0110 1111

The Subtraction Method


For this method, start with a weighted position value greater that the number.
If the number is greater than the weighted position for the digit, write down a 1 and
subtract the weighted position value.
If the number is less than the weighted position for the digit, write down a 0 and subtract
0.
This process is continued until the result is 0. When performing the subtraction, the digits which
will represent the binary equivalent of the decimal number are written beginning at the most
significant digit (the left) and each new digit is written to the next lesser significant digit (on the
right) of the previous digit. Consider the same number, 2671, using a different method.

5
Weighted Value Subtraction Remainder Binary Number

2^12 = 4096 2671 - 0 2671 0

2^11 = 2048 2671 - 2048 623 01

2^10 = 1024 623 - 0 623 0 10

2^9 = 512 623 - 512 111 0 101

2^8 = 256 111 - 0 111 0 1010

2^7 = 128 111 - 0 111 0 1010 0

2^6 = 64 111 - 64 47 0 1010 01

2^5 = 32 47 - 32 15 0 1010 011

2^4 = 16 15 - 0 15 0 1010 0110

2^3 = 8 15 - 8 7 0 1010 0110 1

2^2 = 4 7-4 3 0 1010 0110 11

2^1 = 2 3-2 1 0 1010 0110 111

2^0 = 1 1-1 0 0 1010 0110 1111

Binary Number Formats


We typically write binary numbers as a sequence of bits (bits is short for binary digits). We have
defined boundaries for these bits. These boundaries are:

Name Size (bits) Example

Bit 1 1

Nibble 4 0101

Byte 8 0000 0101

Word 16 0000 0000 0000 0101

Double Word 32 0000 0000 0000 0000 0000 0000 0000 0101

6
In any number base, we may add as many leading zeroes as we wish without changing its value.
However, we normally add leading zeroes to adjust the binary number to a desired size boundary.
For example, we can represent the number five as:

Bit 101

Nibble 0101

Byte 0000 0101

Word 0000 0000 0000 0101

We'll number each bit as follows:


1. The rightmost bit in a binary number is bit position zero.
2. Each bit to the left is given the next successive bit number.
Bit zero is usually referred to as the LSB (least significant bit). The left-most bit is typically
called the MSB (most significant bit). We will refer to the intermediate bits by their respective bit
numbers.

The Bit
The smallest "unit" of data on a binary computer is a single bit. Since a single bit is capable of
representing only two different values (typically zero or one).
The Nibble
A nibble is a collection of bits on a 4-bit boundary.
The Byte
A byte also contains exactly two nibbles. Bits b0 through b3 comprise the low order nibble, and
bits b4 through b7 form the high order nibble.
The Word

A word also contains either 16-bits or two bytes.


The Double Word

A double word is exactly what its name implies, two words. Therefore, a double word quantity is
32 bits. Naturally, this double word can be divided into a high order word and a low order word,
four bytes, or eight nibbles.

7
Hexadecimal Number System
A big problem with the binary system is verbosity. To represent the value 202 requires eight
binary digits.
The decimal version requires only three decimal digits and, thus, represents numbers much more
compactly than does the binary numbering system. This fact was not lost on the engineers who
designed binary computer systems.
When dealing with large values, binary numbers quickly become too unwieldy. The hexadecimal
(base 16) numbering system solves these problems. Hexadecimal numbers offer the two features:
 Hex numbers are very compact
 It is easy to convert from hex to binary and binary to hex.

The Hexadecimal system is based on the binary system using a Nibble or 4-bit boundary. We
place an H at the end of the number to denote the number base.
The Hexadecimal Number System:
 uses base 16
 includes only the digits 0 through 9 and the letters A, B, C, D, E, and F
In the Hexadecimal number system, the hex values greater than 9 carry the following decimal
value:

Binary Octal Decimal Hex

0000B 00Q 00 00H

0001B 01Q 01 01H

0010B 02Q 02 02H

0011B 03Q 03 03H

0100B 04Q 04 04H

0101B 05Q 05 05H

0110B 06Q 06 06H

0111B 07Q 07 07H

1000B 10Q 08 08H

8
1001B 11Q 09 09H

1010B 12Q 10 0AH

1011B 13Q 11 0BH

1100B 14Q 12 0CH

1101B 15Q 13 0DH

1110B 16Q 14 0EH

1111B 17Q 15 0FH

1 0000B 20Q 16 10H

This table provides all the information you'll ever need to convert from one number base into any
other number base for the decimal values from 0 to 16.
To convert a hexadecimal number into a binary number, simply brake the binary number into 4-
bit groups beginning with the LSB and substitute the corresponding four bits in binary for each
hexadecimal digit in the number.
For example, to convert 0ABCDh into a binary value, simply convert each hexadecimal digit
according to the table above. The binary equivalent is:

0ABCDH = 0000 1010 1011 1100 1101

To convert a binary number into hexadecimal format is almost as easy. The first step is to pad the
binary number with leading zeros to make sure that the the binary number contains multiples of
four bits. For example, given the binary number 10 1100 1010, the first step would be to add two
bits in the MSB position so that it contains 12 bits. The revised binary value is 0010 1100 1010.
The next step is to separate the binary value into groups of four bits, e.g., 0010 1100 1010.
Finally, look up these binary values in the table above and substitute the appropriate hexadecimal
digits, e.g., 2CA.
The weighted values for each position is as follows:

16^3 16^2 16^1 16^0

4096 256 16 1

9
Binary to Hex Conversion
It is easy to convert from an integer binary number to hex. This is accomplished by:
1. Break the binary number into 4-bit sections from the LSB to the MSB.
2. Convert the 4-bit binary number to its Hex equivalent.
For example, the binary value 1010111110110010 will be written:

1010 1111 1011 0010

A F B 2

Hex to Binary Conversion


It is also easy to convert from an integer hex number to binary. This is accomplished by:
1. Convert the Hex number to its 4-bit binary equivalent.
2. Combine the 4-bit sections by removing the spaces.
For example, the hex value 0AFB2 will be written:

A F B 2

1010 1111 1011 0010

This yields the binary number 1010111110110010 or 1010 1111 1011 0010 in our more readable
format.
Hex to Decimal Conversion
To convert from Hex to Decimal, multiply the value in each position by its hex weight and add
each value. Using the value from the previous example, 0AFB2H, we would expect to obtain the
decimal value 44978.

A*16^3 F*16^2 B*16^1 2*16^0

10*4096 15*256 11*16 2*1

40960 3840 176 2

40960 + 3840 + 176 + 2 = 44978


Decimal to Hex Conversion
To convert decimal to hex is slightly more difficult. The typical method to convert from decimal
to hex is repeated division by 16. While we may also use repeated subtraction by the weighted
position value, it is more difficult for large decimal numbers.
Repeated Division By 16
For this method, divide the decimal number by 16, and write the remainder on the side as the least
significant digit. This process is continued by dividing the quotient by 16 and writing the

10
remainder until the quotient is 0. When performing the division, the remainders which will
represent the hex equivalent of the decimal number are written beginning at the least significant
digit (right) and each new digit is written to the next more significant digit (the left) of the
previous digit. Consider the number 44978.

Division Quotient Remainder Hex Number

44978 / 16 2811 2 2

2811 / 16 175 11 B2

175 / 16 10 15 FB2

10 / 16 0 10 0AFB2

As you can see, we are back with the original number. That is what we should expect.
When you use hex numbers in an 8085 program, the Assembler usually requires the most
significant hex digit to be 0 even if this number of digits exceed the size of the register. This is an
Assembler requirement and your value will be assembled correctly.

Octal Number System


The Octal Number Base System
Although this was once a popular number base, especially in the Digital Equipment Corporation
PDP/8 and other old computer systems, it is rarely used today. The Octal system is based on the
binary system with a 3-bit boundary. The Octal Number System:
 uses base 8
 includes only the digits 0 through 7 (any other digit would make the number an
invalid octal number)
The weighted values for each position is as follows:

8^5 8^4 8^3 8^2 8^1 8^0

32768 4096 512 64 8 1

Binary to Octal Conversion


It is easy to convert from an integer binary number to octal. This is accomplished by:
1. Break the binary number into 3-bit sections from the LSB to the MSB.
2. Convert the 3-bit binary number to its octal equivalent.

11
For example, the binary value 1010111110110010 will be written:

001 010 111 110 110 010

1 2 7 6 6 2

Octal to Binary Conversion


It is also easy to convert from an integer octal number to binary. This is accomplished by:
1. Convert the decimal number to its 3-bit binary equivalent.
2. Combine the 3-bit sections by removing the spaces.
For example, the octal value 127662 will be written:

1 2 7 6 6 2

001 010 111 110 110 010

This yields the binary number 001010111110110010 or 00 1010 1111 1011 0010 in our more
readable format.
Octal to Decimal Conversion
To convert from Octal to Decimal, multiply the value in each position by its Octal weight and add
each value. Using the value from the previous example, 127662Q, we would expect to obtain the
decimal value 44978.

1*8^5 2*8^4 7*8^3 6*8^2 6*8^1 2*8^0

1*32768 2*4096 7*512 6*64 6*8 2*1

32768 8192 3584 384 48 2

32768 + 8192 + 3584 + 384 + 48 + 2 = 44978


Decimal to Octal Conversion
To convert decimal to octal is slightly more difficult. The typical method to convert from decimal
to octal is repeated division by 8. While we may also use repeated subtraction by the weighted
position value, it is more difficult for large decimal numbers.
Repeated Division By 8
For this method, divide the decimal number by 8, and write the remainder on the side as the least
significant digit. This process is continued by dividing the quotient by 8 and writing the
remainder until the quotient is 0. When performing the division, the remainders which will
represent the octal equivalent of the decimal number are written beginning at the least significant
digit (right) and each new digit is written to the next more significant digit (the left) of the
previous digit. Consider the number 44978.

12
Division Quotient Remainder Octal Number

44978 / 8 5622 2 2

5622 / 8 702 6 62

702 / 8 87 6 662

87 / 8 10 7 7662

10 / 8 1 2 27662

1/8 0 1 127662

As you can see, we are back with the original number. That is what we should expect.

13
CODING METHODS

We have said any information to be processed by a digital computer (numbers,


characters, pictures…) has to be as a series of electrical switches (no’s and off’s) in
arranged manner. Or simply it should be represented by the two digits of the binary
number system.

There are different coding systems that convert one or more character sets into computer
codes. Examples are BCD and ACSII

BCD (4-bits)

 Stands for Binary Coded Decimal


 It converts every digit of a decimal number to binary.

Coding Examples

Decimal Number BCD

81 1000 0001
935 1001 0011 0101

ASCII-7

 ASCII stands for American Standard Code for Information Interchange


 Used widely before the introduction of ASCII-8 (the Extended ASCII)
 Uses 7 bits to represent a character;
 With the seven bits, 27( or 128) different characters can be coded (0000000-
1111111)
 It has a zone and digit bits positions

14
Coding exemples:

ASCII-7
Character Zone digit
$ 010 0100
% 010 0101
A 100 0001
a 110 0001
b 110 0010

The ASCII System


 ASCII stands for American Standard Code for Information Interchange
 It is the most widely used type of coding scheme for Micro Computer system
 ASCII uses 8-bits to represent alphanumeric characters (letters, digits and special
symbols).
 With the 8-bits, ASCII can represent 28 or 256 different characters (00000000-
11111111).

Coding Examples

Character Binary representation in ASCII


a 01100001
b 01100010
A 01000001
B 01000010
? 00111111
+ 00101011
1 00110001
0 00110010
1 00110011

15
Representation of Numbers

Negative Numbers

All the numbers you've looked at so far have been positive whole numbers. There is no
equivalent in binary to the minus sign so other ways have been devised to represent
negative values. The two most widely used are:

1. Sign and magnitude (signed magnitude);


2. Two’s complement.

Sign and Magnitude (signed magnitude)

When a value is represented using sign and magnitude, the left hand bit, the most
significant bit, is used solely to determine the sign of the number.

Most significant bit = 1 Negative number


Most significant bit = 0 Positive number

For example:
1010 = -2
0010 = +2

Activity:

Represent -4 using sign and magnitude form.

Solution

The magnitude of a number 4 in binary is 100, since the number is negative add 1 to the
left most position of the number; hence 1100

16
Decimal number Sign bit Magnitude Sign Magnitude
representation
+4 0 100 0100
-4 1 100 1100

+5 0 101 0101

-5 1 101 1101

This means that a 4-bit number cannot represent any value greater than 7 because the 4th
bit is used to indicate the sign. However the 4 bits can still represent 15 different values
when the negative numbers are included. These values are:
-7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7

If there was no sign bit, 4 bits would represent the following 16 values:
0, 1, 2, 3, 4, 5 , 6, 7, 8, 9, 10, 11, 12, 13, 14, 15

Activity
Can you work out why there are only 15 values when you use sign and magnitude but 16 when there is no
sign bit?

Two's Complement

Decimal arithmetic uses different operations for addition and subtraction. Using two's
complement, subtraction is carried out using the machine operation for addition. This
system works for bit strings of any length. The examples given will use 8 or 4-bit strings
for simplicity but a working PC is likely to use 32 or 64-bit strings. The first bit is again
used to indicate a negative value but it also bears the position value.

The two's complement number 1000 1010 is evaluated as follows:


1000 1010
= -128 +0+0+0+8+0+2+0
= -118

17
Converting a number to its negative form is a two-stage process:

1. Complement (invert) all the bits (the result at this stage is known as one's
complement).
2. Add 1.

If you're working with 8-bit strings all values must appear as 8 bits and the possible
values will be in the range -128 to 127.

Example
Using a 4-bit binary string
To convert 1101 (1310) to its negative:

Write the number in 8 bit format 0000 1101


Invert the bits 1111 0010
Add 1 0000 0001
1111 0011

It is easy to check the answer:


1111 0011
= -128 +64 +32 +16 +0 +0 +2 +1
= -128 + 115
= -13

18
Activity:

Represent the decimal numbers (1, 4, 7) in to its 2`s compliment form?

The table below shows the two's complement representation of the range -8 to + 7

Decimal Binary two's complement


representation
7 0111
6 0110
5 0101
4 0100
3 0011
2 0010
1 0001
0 0000
-1 1111
-2 1110
-3 1101
-4 1100
-5 1011
-6 1010
-7 1001
-8 1000

When 1 is added to the binary representation for -1 the result is a 5-bit number. Because
the machine has only allocated 4 bits, the 5th bit is ignored as overflow. This same
process can be used to convert negative numbers to positive. This ability to treat positive
and negative numbers in the same way is the reason that two's complement is the most
commonly used machine representation for negative numbers.

19
Boolean algebra
Definition:
Boolean algebra is an algebra that deals with binary numbers.

Fundamental concepts of Boolean algebra


1. use of binary digit
Since Boolean algebra deals with binary number system the variables used in the Boolean
equation may assume only two possible values (1) and (0).

2. logical addition
The symbol “+” is used for logical addition. It is also known as “or” operator.
The resulting out put values four each of the four (since the variable in the equation say A
and B can have only two possible values (0 and 1) so only four (22 ) combination of input
are possible) input combinations are given in the following table

3: logical multiplication
The symbol “.” is used for logical multiplication. It is also known as “and” operator.
The resulting out put values four each of the four (since the variable in the equation say A
and B can have only two possible values (0 and 1) so only four (22 ) combination of input
are possible) input combinations are given in the following table

Complementation
The symbol for compliment operator is “-“. It is also known as an inverter.
The compliment of a variable is the reverse of its value.

20
The NOT operation is unlike the OR and AND operations in that it can be
performed on a single input variable. For example, if the variable A is subjected
to the NOT operation, the result x can be expressed as

X = A'

Where the prime (') represents the NOT operation. This expression is read as:
x equals NOT A
x equals the inverse of A
x equals the complement of A

Each of these is in common usage and all indicate that the logic value of x = A' is
opposite to the logic value of A.

The truth table of the NOT operation is as follows:

1' = 0 because NOT 1 is 0


0' = 1 because NOT 0 is 1

The NOT operation is also referred to as inversion or complementation,


and these terms are used interchangeably.

Operator precedence

In order to evaluate Boolean expression correctly the following Boolean operation


precedence is useful

1. First, perform all inversions of single terms; that is, 0 = 1 or 1 = 0.


2. Then perform all operations within parentheses.
3. Perform an AND operation before an OR operation unless parentheses
indicate otherwise.

21
4. If an expression has a bar over it, perform the operations of the
expression first and then invert the result.

Postulates of Boolean theorems

Investigating the various Boolean theorems (rules) can help us to simplify logic
expressions and logic circuits

(9)x + y = y + x (commutative law)


(10)x * y = y * x (commutative law)
(11)x+ (y+z) = (x+y) +z = x+y+z (associative law)
(12)x (yz) = (xy) z = xyz (associative law)
(13a)x (y+z) = xy + xz
(13b)(w+x)(y+z) = wy + xy + wz + xz
(14)x + xy = x
(15)x + x'y = x + y

22
DeMorgan's Theorem

DeMorgan's theorems are extremely useful in simplifying expressions in which a


product or sum of variables is inverted. The two theorems are:

(16) (x+y)' = x' * y'

(17) (x*y)' = x' + y'

Theorem (16) says that when the OR sum of two variables is inverted, this is the
same as inverting each variable individually and then ANDing these inverted
variables.

Theorem (17) says that when the AND product of two variables is inverted, this is
the same as inverting each variable individually and then ORing them.

Example

X = [(A'+C) * (B+D')]'
= (A'+C)' + (B+D')' [by theorem (17)]
= (A''*C') + (B'+D'') [by theorem (16)]
= AC' + B'D

Boolean function

It is an expression formed with binary variables, the two binary operators and the
unary operator, parenthesis and equal sign.

Example

W=x+ y-.z

23
The above function can also be represented using truth table

X Y Z y- y-.z W=x+ y-.z


0 0 0 1 0 0

0 0 1 1 1 1

0 1 0 0 0 0

0 1 1 0 0 0

1 0 0 1 0 1

1 0 1 1 1 1

1 1 0 0 0 1

1 1 1 0 0 1

Machine representation for negative numbers.

Logic Gates and Circuit

Objective:
At the end of this section the learner will be able to:
 Define logic gates, Boolean algebra, and logic circuit.
 Determine types of logic gates.
 Simplify a given Boolean function
 Design simple logic circuits.
 Evaluate a value of a given logic circuit.

This topic introduces Boolean logic and logic gates. This form of logic is the basis of
current electronic computers, and is also widely used by programmers when writing
systems.

24
Boolean logic is a way of expressing a bit of information as one of two states, TRUE or
FALSE. There are no intermediate states. Typically, TRUE is represented as a small
positive voltage, and FALSE is a zero voltage. Many people think of these two states as
being On and Off.

Definition:

A logic gate is a device that gives a predictable output when given specific
inputs

In an electronic computer the gates are implemented using electronic logic, with modern
systems typically containing millions of these devices integrated into a few silicon chips
appearing on the circuit board.

Boolean 0 and 1 do not represent actual numbers but instead represent the state of a
voltage variable, or what is called its logic level.

Some common representation of 0 and 1 is shown in the following diagram.

Logic 0 Logic 1
False True
Off On
Low High
No Yes
Open Switch Close Switch

In Boolean algebra, there are three basic logic operations:


OR, AND and NOT. These logic gates are digital circuits constructed from diodes,
transistors, and resistors connected in such a way that the circuit output is the result of a
basic logic operation (OR, AND, NOT) performed on the inputs.

OR gate

The expression X = A + B reads as "X equals A OR B".


The + sign stands for the OR operation, not for ordinary addition.

The OR operation produces a result of 1 when any of the input variable is 1.

25
The OR operation produces a result of 0 only when all the input variables are 0.

AND Gate

The expression X = A * B reads as "X equals A AND B".


The multiplication sign stands for the AND operation, same for ordinary
multiplication of 1s and 0s.

The AND operation produces a result of 1 occurs only for the single case when all
of the input variables are 1.

The output is 0 for any case where one or more inputs are 0

26
NOT Gate

The NOT operation is unlike the OR and AND operations in that it can be
performed on a single input variable. For example, if the variable A is subjected
to the NOT operation, the result x can be expressed as

X = A'

Where the prime (') represents the NOT operation. This expression is read
as:
x equals NOT A
x equals the inverse of A
x equals the complement of A

Each of these is in common usage and all indicate that the logic value of x
= A' is opposite to the logic value of A.

The truth table of the NOT operation is as follows:

27
NOR Gate

NOR is the same as the OR gate symbol except that it has a small circle on the
output. This small circle represents the inversion operation. Therefore the output
expression of the two input NOR gate is:

X = ( A + B )'

NAND Gate

NAND is the same as the AND gate symbol except that it has a small circle on the
output. This small circle represents the inversion operation. Therefore the output
expression of the two input NAND gate is:

X = ( AB )'

28
QUIZ Questions

Choose the correct answers in the following questions.

1. Boolean algebra is different from ordinary algebra in which way?


a) Boolean algebra can represent more than 1 discrete level between 0 and 1
b) Boolean algebra have only 2 discrete levels: 0 and 1
c) Boolean algebra can describe up to 3 levels of logic levels
d) They are actually the same
The following 2 questions are referred to the below image:

2. What is the output X if both inputs A and B are 0?


a) 0
b) 1
c) I don't know
d) No Answer

29
3. What is the output X if A=1 and B=0?
a) 0
b) 1
c) I don't know
d) No Answer
4. For a three inputs (A,B C) OR gate, what inputs are needed if output=0?
a) A=0, B=0, C=1
b) A=0, B=1, C=0
c) A=1, B=1, C=1
d) A=0, B=0,C=0
e) No Answer

Logic circuits
Describing Logic Circuits Algebraically

Any logic circuit, no matter how complex, may be completely described using the
Boolean operations, because the OR gate, AND gate, and NOT circuit are the
basic building blocks of digital systems.

This is an example of the circuit using Boolean expression:

Note:

If an expression contains both AND and OR operations, the AND operations are
performed first (X=AB+C: AB is performed first), unless there are parentheses in
the expression, in which case the operation inside the parentheses is to be
performed first (X= (A+B) +C: A+B is performed first).

30
Evaluating Logic Circuit Outputs

Once the Boolean expression for a circuit output has been obtained, the output
logic level can be determined for any set of input levels.

Example:

Let A=0, B=1, C=1, D=1

X = A'BC (A+D)'
= 0'*1*1* (0+1)'
= 1 *1*1* (1)'
= 1 *1*1* 0
=0

Implementing Circuits from Boolean Expression

If the operation of a circuit is defined by a Boolean expression, a logic-circuit


diagram can he implemented directly from that expression.

Suppose that we wanted to construct a circuit whose output is y = AC+BC' +


A'BC. This Boolean expression contains three terms (AC, BC', A'BC), which are
ORed together. This tells us that a three-input OR gate is required with inputs that
are equal to AC, BC', and A'BC, respectively.

Each OR-gate input is an AND product term, which means that an AND gate with
appropriate inputs can be used to generate each of these terms. Note the use of Inverters
to produce the A' and C' terms required in the expression.

31
Universality of NAND & NOR Gates

It is possible to implement any logic expression using only NAND gates and no other
type of gate. This is because NAND gates, in the proper combination, can be used to
perform each of the Boolean operations OR, AND, and INVERT.

32

You might also like