0% found this document useful (0 votes)
7 views

Lecture # 2C - Numbers Systems, Operations and Codes

Uploaded by

Hasnain Nisar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Lecture # 2C - Numbers Systems, Operations and Codes

Uploaded by

Hasnain Nisar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

DEPARTMENT OF COMPUTER SCIENCE &

INFORMATION TECHNOLOGY

Logic Design & Switching Theory

Course Code: CS-251


Semester: Spring 2020
Teacher Name: Talha Akhtar
Course Contents
Introduction of Subject
1. Digital fundamentals and Analog Quantities
2. Basic Logic Function & Boolean Algebra
3. Numbers Systems, Operations and Codes
4. Logic Gates
5. Fundamental Theorems of Boolean Algebra
6. Minimization of Boolean Functions
7. Karnaugh map
8. Simplification of Boolean Functions, POS
9. Function of Combinational Logic
10.Latshes, Flip-Flops, and Timmer
Numbers Systems, Operations and Codes
The binary number system and digital codes are fundamental to
computer and to digital electronics.

The number are decimal, hexadecimal and octal.

Arithmetic operations with binary number are covered to provide a


basis for understanding how computer and many other types of
digital system works.
Octal Numbers
The octal number system is composed of eight digits, which are
0,1,2,3,4,5,6,7
To count above 7, begin another column and start over:
10,11,12,13,14,15,16,17,20,21,…
Counting in octal is similar to counting numbers from decimal,
except that the digit 8 and 9 are not used.

We will used subscript 8 to indicate octal number, for instant 158


In octal equivalent to 1310 In decimal and D in hexadecimal.

Sometimes You may see an ‘’o’’ or a “O” following octal number.


Octal Numbers
Octal to decimal Conversion
The octal number system has a base of eight, each successive digit
position is an increasing power of eight, beginning in the right-most
column 80
The evaluation of an octal numbers in terms of hexadecimal equivalent is
accomplished by multiplying each digit by its weight and summing the
products.
For example 23748
Weight: 83 82 81 80
Octal number: 2 3 7 4
23748 = (2 x 83) + (3 x 82) + (7 x 81) + (4 x 80)
= (2 x 512) + (3 x 64) + (7 x 8) + (4 x 1)
= 1024 + 192 + 56 + 4
= 127610
Octal Numbers
Decimal to Octal Conversion

A method of converting a decimal number to an octal number is repeated


division by 8 method same as conversion from decimal to binary or a
hexadecimal number.

e.g. 359/8 = 44.875 -> 0.875 x 8 = 7


44/8 = 5.5 -> 0.5 x 8 = 4
5/8 = 0.625 -> 0.625 x 8 = 5
stop to zero
Result 5 4 7

MSD LSD
Octal Numbers
Octal to Binary Conversion

Octal digit 0 1 2 3 4 5 6 7
Binary 000 001 010 011 100 101 110 111

a)Octal -> 138 b)Octal -> 258

Binary -> 001011 Binary -> 010101

c)Octal -> 1408 d)Octal -> 75268

Binary -> 001100000 Binary -> 111101010110


Octal Numbers
Binary to Octal Conversion

Conversion of a binary number to an octal number is the reverse of the octal to


binary conversion.

a)Binary -> 110101 b) Binary -> 101111001

Octal -> 658 Octal -> 5718

c) Binary -> 100110011010 d) Binary -> 011010000100

Octal -> 46328 Octal -> 32048


Octal Numbers
Binary coded Decimal
It is way to express each of the decimal digits with a binary code.

Decimal Digit 0 1 2 3 4 5 6 7 8 9
BCD 0000 0001 0010 0011 0100 0101 0110 0111 1000
1001
Convert decimal to BCD
a) 3 5 b) 9 8
0011 0101 1001 1000

c) 1 7 0 d) 2 4 6 9
0001 0111 0000 0010 0100 0110 1001

PROBLEM

Convert the decimal number 9673 to BCD.


Octal Numbers
Convert BCD Codes to decimal

a) 10000110
1000 01110
8 6
b) 001101010001
3 5 1

c) 1001010001110000
9 4 7 0
Octal Numbers
Add the following BCD Numbers

a) 0011 + 0100 b) 00100011 + 00010101


0011 3 0010 0011 23
+ 0100 +4 + 0001 0101 + 15
0111 7 0011 1000 38

c) 1000 0110 86 d) 0100 0101 0000 450


+ 0001 0011 +13 + 0100 0001 01111 + 417
1001 1001 99 1000 0110 0111 867
Digital Codes
Many specialized codes are used in digital systems. Some codes are
strictly numeric, like BCD, and others are alpanumeric that is, they
are used to represent numbers, letters, symbols, and instructions.

The codes are Gray code, ASCII Code and Unicode.

Gray Code
It is unweighted and it is not arithmetic code. There are no specific
weight assigned to the bit positions. It only a single bit change from
one code wd to next in sequence.
Digital Codes
Alphanumeric Codes.

It is a combination of both numeric as well as alphabetic


characters.
10 decimal value
26 characters
36 Total combinations
Digital Codes
ASCII

ASCII is the abbreviation for American Standard Code for


information interchange.
ASCII is a universally accepted alphanumeric code used in most
computer and electronic equipment.
Most computer keys standardized with the ASCII.
ASCII has 128 characters and symbol.
7 bit binaty code
Digital Codes
Extended ASCII Characters

128 standard ASCII


128 characters that adopted by IBM for their PCs.

Unicode
It is universal character set (UCS).
It is used for multilingual text, mathematical symbol or other
technical characters.
Digital Codes
Errors Code.

Many system use parity bit as a means for bit error detection.
Digital Codes
Summary
- Binary number is a weighted numbers is a positive power of two
and the weight of each fractional digit.
- A binary number is converted to decimal by summing the
decimal values of the weights of the 1s in the binary number.
- A decimal is converted to binary by summing the weights of the
repeated division by 2 method.
- A decimal weight is converted to binary.
- The basic rules of binary addition, subtraction.
- 1’s complement and 2’s complement
- Positive and negative number
Digital Codes
Summary
- Arithmetic operation
- Hexadecimal numbers
- Convert decimal to hexadecimal
- Octal to binary
- Decimal to BCD
- ASCII
- Alphanumeric
- BCD
- LSB
- MSB
Digital Codes
Summary
- Octal
- Parity
END

Q/A

You might also like