0% found this document useful (0 votes)
2 views22 pages

unit 3

The document covers various number systems including decimal, binary, octal, and hexadecimal, explaining their bases, characteristics, and conversion methods. It also discusses logic gates, Boolean algebra, and binary arithmetic, providing examples and rules for operations like addition, subtraction, multiplication, and division. Additionally, it introduces coding systems like BCD and Gray code, along with their advantages and applications.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views22 pages

unit 3

The document covers various number systems including decimal, binary, octal, and hexadecimal, explaining their bases, characteristics, and conversion methods. It also discusses logic gates, Boolean algebra, and binary arithmetic, providing examples and rules for operations like addition, subtraction, multiplication, and division. Additionally, it introduces coding systems like BCD and Gray code, along with their advantages and applications.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 22

Unit 3 - Number Systems, Logic Gates, Boolean Algebra and Simplification of

Logic Expressions

Decimal Number System


The number system that we use in our day-to-day life is the decimal number system. Decimal
number system has base 10 as it uses 10 digits from 0 to 9. In decimal number system, the
successive positions to the left of the decimal point represent units, tens, hundreds, thousands,
and so on.

Each position represents a specific power of the base (10). For example, the decimal number
1234 consists of the digit 4 in the units position, 3 in the tens position, 2 in the hundreds
position, and 1 in the thousands position. Its value can be written as

(1 x 1000)+ (2 x 100)+ (3 x 10)+ (4 x l)


(1 x 103)+ (2 x 102)+ (3 x 101)+ (4 x l00)
1000 + 200 + 30 + 4
1234
As a computer programmer or an IT professional, you should understand the following number systems
which are frequently used in computers.

S.No. Number System and Description

Binary Number System


1
Base 2. Digits used : 0, 1

Octal Number System


2
Base 8. Digits used : 0 to 7

Hexa Decimal Number System


3
Base 16. Digits used: 0 to 9, Letters used : A- F

Binary Number System


Characteristics of the binary number system are as follows −

 Uses two digits, 0 and 1

 Also called as base 2 number system


 Each position in a binary number represents a value of power of base (2) starting from
the position numbered from 0,1,2,etc. Example 20,21,etc

Example:
Binary Number: 101012

Calculating Decimal Equivalent −

Step Binary Number Decimal Number

Step 1 101012 ((1 x 24) + (0 x 23) + (1 x 22) + (0 x 21) + (1 x 20))10

Step 2 101012 (16 + 0 + 4 + 0 + 1)10

Step 3 101012 2110

Octal Number System


Characteristics of the octal number system are as follows −

 Uses eight digits, 0,1,2,3,4,5,6,7

 Also called as base 8 number system

 Each position in a octal number represents a value of power of base (8) starting from the
position numbered from 0,1,2,etc. Example 80,81,etc

Example;
Octal Number: 125708

Calculating Decimal Equivalent −

Step Octal Number Decimal Number

Step 1 125708 ((1 x 84) + (2 x 83) + (5 x 82) + (7 x 81) + (0 x 80))10


Step 2 125708 (4096 + 1024 + 320 + 56 + 0)10

Step 3 125708 549610

Hexadecimal Number System


Characteristics of hexadecimal number system are as follows −

 Uses 10 digits and 6 letters, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

 Letters represent the numbers starting from 10. A = 10. B = 11, C = 12, D = 13, E = 14,
F = 15

 Also called as base 16 number system

 Each position in a hexadecimal number represents a value of power of base (16) starting
from the position numbered from 0,1,2,etc. Example 160,161,etc

Example:
Hexadecimal Number: 19FDE16

Calculating Decimal Equivalent −

Step Binary Decimal Number


Number

Step 1 19FDE16 ((1 x 164) + (9 x 163) + (F x 162) + (D x 161) + (E x 160))10

Step 2 19FDE16 ((1 x 164) + (9 x 163) + (15 x 162) + (13 x 161) + (14 x 160))10

Step 3 19FDE16 (65536+ 36864 + 3840 + 208 + 14)10

Step 4 19FDE16 10646210

Other Base System to Decimal System


Step 1 − Determine the column (positional) value of each digit (this depends on the position of
the digit and the base of the number system).

Step 2 − Multiply the obtained column values (in Step 1) by the digits in the corresponding
columns.

Step 3 − Sum the products calculated in Step 2. The total is the equivalent value in decimal.

Example
Binary Number: 111012

Calculating Decimal Equivalent −

Step Binary Number Decimal Number

Step 1 111012 ((1 x 24) + (1 x 23) + (1 x 22) + (0 x 21) + (1 x 20))10

Step 2 111012 (16 + 8 + 4 + 0 + 1)10

Step 3 111012 2910

Binary Number : 111012 = Decimal Number : 2910

Other Base System to Non-Decimal System


Step 1 − Convert the original number to a decimal number (base 10).

Step 2 − Convert the decimal number so obtained to the new base number.

Example
Octal Number : 258

Calculating Binary Equivalent −

Step 1 - Convert to Decimal


Step Octal Number Decimal Number

Step 1 258 ((2 x 81) + (5 x 80))10


Step 2 258 (16 + 5)10

Step 3 258 2110

Octal Number : 258 = Decimal Number : 2110

Step 2 - Convert Decimal to Binary


Step Operation Result Remainder

Step 1 21 / 2 10 1

Step 2 10 / 2 5 0

Step 3 5/2 2 1

Step 4 2/2 1 0

Step 5 1/2 0 1

Decimal Number : 2110 = Binary Number : 101012

Octal Number : 258 = Binary Number : 101012

Shortcut Method ─ Binary to Octal


Step 1 − Divide the binary digits into groups of three (starting from the right).

Step 2 − Convert each group of three binary digits to one octal digit.

Example
Binary Number : 101012

Calculating Octal Equivalent −

Step Binary Number Octal Number


Step 1 101012 010 101

Step 2 101012 28 58

Step 3 101012 258

Binary Number : 101012 = Octal Number : 258

Shortcut Method ─ Octal to Binary


Step 1 − Convert each octal digit to a 3-digit binary number (the octal digits may be treated as
decimal for this conversion).

Step 2 − Combine all the resulting binary groups (of 3 digits each) into a single binary number.

Example
Octal Number : 258

Calculating Binary Equivalent −

Step Octal Number Binary Number

Step 1 258 210 510

Step 2 258 0102 1012

Step 3 258 0101012

Octal Number : 258 = Binary Number : 101012

Shortcut Method ─ Binary to Hexadecimal


Step 1 − Divide the binary digits into groups of four (starting from the right).

Step 2 − Convert each group of four binary digits to one hexadecimal symbol.

Example
Binary Number : 101012
Calculating hexadecimal Equivalent −

Step Binary Number Hexadecimal Number

Step 1 101012 0001 0101

Step 2 101012 110 510

Step 3 101012 1516

Binary Number : 101012 = Hexadecimal Number : 1516

Shortcut Method - Hexadecimal to Binary


Step 1 − Convert each hexadecimal digit to a 4-digit binary number (the hexadecimal digits
may be treated as decimal for this conversion).

Step 2 − Combine all the resulting binary groups (of 4 digits each) into a single binary number.

Example
Hexadecimal Number : 1516

Calculating Binary Equivalent −

Step Hexadecimal Number Binary Number

Step 1 1516 110 510

Step 2 1516 00012 01012

Step 3 1516 000101012

Hexadecimal Number : 1516 = Binary Number : 101012

Binary Coded Decimal (BCD) code


In this code each decimal digit is represented by a 4-bit binary number. BCD is a way to express
each of the decimal digits with a binary code. In the BCD, with four bits we can represent
sixteen numbers (0000 to 1111). But in BCD code only first ten of these are used (0000 to
1001). The remaining six code combinations i.e. 1010 to 1111 are invalid in BCD.

Advantages of BCD Codes

 It is very similar to decimal system.


 We need to remember binary equivalent of decimal numbers 0 to 9 only.

Disadvantages of BCD Codes


 The addition and subtraction of BCD have different rules.

 The BCD arithmetic is little more complicated.

 BCD needs more number of bits than binary to represent the decimal number. So BCD is
less efficient than binary.

Excess-3 code
The Excess-3 code is also called as XS-3 code. It is non-weighted code used to express decimal
numbers. The Excess-3 code words are derived from the 8421 BCD code words adding (0011)2
or (3)10 to each code word in 8421. The excess-3 codes are obtained as follows −

Example
Gray Code
It is the non-weighted code and it is not arithmetic codes. That means there are no specific
weights assigned to the bit position. It has a very special feature that, only one bit will change
each time the decimal number is incremented as shown in fig. As only one bit changes at a time,
the gray code is called as a unit distance code. The gray code is a cyclic code. Gray code cannot
be used for arithmetic operation.

Application of Gray code


 Gray code is popularly used in the shaft position encoders.

 A shaft position encoder produces a code word which represents the angular position of
the shaft.

Binary system complements


As the binary system has base r = 2. So the two types of complements for the binary system are
2's complement and 1's complement.

1's complement
The 1's complement of a number is found by changing all 1's to 0's and all 0's to 1's. This is
called as taking complement or 1's complement. Example of 1's Complement is as follows.
2's complement
The 2's complement of binary number is obtained by adding 1 to the Least Significant Bit
(LSB) of 1's complement of the number.

2's complement = 1's complement + 1

Example of 2's Complement is as follows.

Binary arithmetic is essential part of all the digital computers and many other digital system.

Binary Addition
It is a key for binary subtraction, multiplication, division. There are four rules of binary
addition.
In fourth case, a binary addition is creating a sum of (1 + 1 = 10) i.e. 0 is written in the given
column and a carry of 1 over to the next column.

Example − Addition

Binary Subtraction
Subtraction and Borrow, these two words will be used very frequently for the binary
subtraction. There are four rules of binary subtraction.

Example − Subtraction

Binary Multiplication
Binary multiplication is similar to decimal multiplication. It is simpler than decimal
multiplication because only 0s and 1s are involved. There are four rules of binary
multiplication.
Example − Multiplication

Binary Division
Binary division is similar to decimal division. It is called as the long division procedure.

Example − Division

Positive and Negative logic:

Binary logic is always 0s and 1s. There is only one little problem though, electricity doesn’t
come in 0s or 1s it comes in high or low voltage. So, you need to kind of assign which is which.
And most of the time high voltage was assigned to be 1 and low voltage to be 0.

But you could also assign a high voltage to mean 0 and the low voltage to be 1 and there you
have it: negative logic.

You can of course create whole circuits using negativ logic, but most of the time it’s only used
for things like enable inputs or similar. You can easily spot them by the line on top of the input
name like: ENwhich would be an enable input that enables whatever can be enabled and disabled
by that input with a low voltage on this input.

Logic Gates:

Logic gates are the basic building blocks of any digital system. It is an electronic circuit having
one or more than one input and only one output. The relationship between the input and the
output is based on a certain logic. Based on this, logic gates are named as AND gate, OR gate,
NOT gate etc.

AND Gate:
A circuit which performs an AND operation is shown in figure. It has n input (n >= 2) and one
output.

Logic diagram

Truth Table

OR Gate
A circuit which performs an OR operation is shown in figure. It has n input (n >= 2) and one
output.
Logic diagram

Truth Table

NOT Gate
NOT gate is also known as Inverter. It has one input A and one output Y.

Logic diagram

Truth Table

NAND Gate
A NOT-AND operation is known as NAND operation. It has n input (n >= 2) and one output.
Logic diagram

Truth Table

NOR Gate
A NOT-OR operation is known as NOR operation. It has n input (n >= 2) and one output.

Logic diagram

Truth Table

XOR Gate
XOR or Ex-OR gate is a special type of gate. It can be used in the half adder, full adder and
subtractor. The exclusive-OR gate is abbreviated as EX-OR gate or sometime as X-OR gate. It
has n input (n >= 2) and one output.

Logic diagram

Truth Table

XNOR Gate
XNOR gate is a special type of gate. It can be used in the half adder, full adder and subtractor.
The exclusive-NOR gate is abbreviated as EX-NOR gate or sometime as X-NOR gate. It has n
input (n >= 2) and one output.

Logic diagram
Truth Table

Boolean Algebra

Boolean Algebra is used to analyze and simplify the digital (logic) circuits. It uses only the
binary numbers i.e. 0 and 1. It is also called as Binary Algebraor logical Algebra. Boolean
algebra was invented by George Boole in 1854.

Rule in Boolean Algebra


Following are the important rules used in Boolean algebra.

 Variable used can have only two values. Binary 1 for HIGH and Binary 0 for LOW.

 Complement of a variable is represented by an overbar (-). Thus, complement of variable


B is represented as . Thus if B = 0 then = 1 and B = 1 then = 0.

 ORing of the variables is represented by a plus (+) sign between them. For example
ORing of A, B, C is represented as A + B + C.

 Logical ANDing of the two or more variable is represented by writing a dot between
them such as A.B.C. Sometime the dot may be omitted like ABC.
As well as the logic symbols “0” and “1” being used to represent a digital input or output, we can
also use them as constants for a permanently “Open” or “Closed” circuit or contact respectively.
A set of rules or Laws of Boolean Algebra expressions have been invented to help reduce the
number of logic gates needed to perform a particular logic operation resulting in a list of
functions or theorems known commonly as the Laws of Boolean Algebra.
Boolean Algebra is the mathematics we use to analyse digital gates and circuits. We can use
these “Laws of Boolean” to both reduce and simplify a complex Boolean expression in an
attempt to reduce the number of logic gates required. Boolean Algebra is therefore a system of
mathematics based on logic that has its own set of rules or laws which are used to define and
reduce Boolean expressions.
The variables used in Boolean Algebra only have one of two possible values, a logic “0” and a
logic “1” but an expression can have an infinite number of variables all labelled individually to
represent inputs to the expression, For example, variables A, B, C etc, giving us a logical
expression of A + B = C, but each variable can ONLY be a 0 or a 1.
Examples of these individual laws of Boolean, rules and theorems for Boolean Algebra are given
in the following table.

Truth Tables for the Laws of Boolean

Boolean Equivalent Boolean Algebra


Description
Expression Switching Circuit Law or Rule

A in parallel with
A+1=1 Annulment
closed = "CLOSED"

A in parallel with
A+0=A Identity
open = "A"

A in series with
A.1=A Identity
closed = "A"

A in series with
A.0=0 Annulment
open = "OPEN"

A in parallel with
A+A=A Idempotent
A = "A"
A in series with
A.A=A Idempotent
A = "A"

NOT A = A NOT NOT A


Double Negation
(double negative) = "A"

A+A=1
A in parallel with
Complement
NOT A = "CLOSED"

A.A=0
A in series with
Complement
NOT A = "OPEN"

A in parallel with B =
A+B = B+A Commutative
B in parallel with A

A in series with B =
A.B = B.A Commutative
B in series with A

A+B = A.B invert and replace OR with AND de Morgan’s Theorem

A.B = A+B invert and replace AND with OR de Morgan’s Theorem


The basic Laws of Boolean Algebra that relate to the Commutative Law allowing a change in
position for addition and multiplication, the Associative Law allowing the removal of brackets
for addition and multiplication, as well as the Distributive Law allowing the factoring of an
expression, are the same as in ordinary algebra.
Each of the Boolean Laws above are given with just a single or two variables, but the number of
variables defined by a single law is not limited to this as there can be an infinite number of
variables as inputs too the expression. These Boolean laws detailed above can be used to prove
any given Boolean expression as well as for simplifying complicated digital circuits.
A brief description of the various Laws of Boolean are given below with A representing a
variable input.

Description of the Laws of Boolean Algebra

Annulment Law – A term AND´ed with a “0” equals 0 or OR´ed with a “1” will equal 1

o A.0=0 A variable AND’ed with 0 is always equal to 0


o A+1=1 A variable OR’ed with 1 is always equal to 1

Identity Law – A term OR´ed with a “0” or AND´ed with a “1” will always equal that term

o A + 0 = A A variable OR’ed with 0 is always equal to the variable


o A.1=A A variable AND’ed with 1 is always equal to the variable

Idempotent Law – An input that is AND´ed or OR´ed with itself is equal to that input

A+A=A A variable OR’ed with itself is always equal to the variable

o A.A=A A variable AND’ed with itself is always equal to the variable

Complement Law – A term AND´ed with its complement equals “0” and a term OR´ed with
its complement equals “1”

A . A = 0 A variable AND’ed with its complement is always equal to 0


A + A = 1 A variable OR’ed with its complement is always equal to 1

Commutative Law – The order of application of two separate terms is not important

o A.B=B.A The order in which two variables are AND’ed makes no


difference
o A+B=B+A The order in which two variables are OR’ed makes no
difference

Double Negation Law – A term that is inverted twice is equal to the original term

o A=A A double complement of a variable is always equal to the variable

de Morgan´s Theorem – There are two “de Morgan´s” rules or theorems,

(1) Two separate terms NOR´ed together is the same as the two terms inverted (Complement)
and AND´ed for example: A+B = A . B

(2) Two separate terms NAND´ed together is the same as the two terms inverted
(Complement) and OR´ed for example: A.B = A + B

Other algebraic Laws of Boolean not detailed above include:

 Distributive Law – This law permits the multiplying or factoring out of an expression.

o A(B + C) = A.B + A.C (OR Distributive Law)


o A + (B.C) = (A + B).(A + C) (AND Distributive Law)

Absorptive Law – This law enables a reduction in a complicated expression to a simpler


one by absorbing like terms.
A + (A.B) = A (OR Absorption Law)

o A(A + B) = A (AND Absorption Law)

Associative Law – This law allows the removal of brackets from an expression and
regrouping of the variables.

o A + (B + C) = (A + B) + C = A + B + C (OR Associate Law)


o A(B.C) = (A.B)C = A . B . C (AND Associate Law)

Laws of Boolean Algebra


Using the above laws, simplify the following expression: (A + B)(A + C)

Q= (A + B).(A + C)

A.A + A.C + A.B + B.C – Distributive law

A + A.C + A.B + B.C – Idempotent AND law (A.A = A)

A(1 + C) + A.B + B.C – Distributive law

A.1 + A.B + B.C – Identity OR law (1 + C = 1)

A(1 + B) + B.C – Distributive law

A.1 + B.C – Identity OR law (1 + B = 1)

Q= A + (B.C) – Identity AND law (A.1 = A)

Then the expression: (A + B)(A + C) can be simplified to A + (B.C) as in the Distributive law.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy