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

Number System

The document provides an overview of number systems, including binary, octal, decimal, and hexadecimal, along with methods for converting between these bases. It covers various categories of conversions, including decimal to any base, any base to decimal, and any base to any base, with examples for each. Additionally, it discusses signed magnitude forms, complements, error detection methods like parity and Hamming code, and introduces basic concepts of Boolean algebra.

Uploaded by

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

Number System

The document provides an overview of number systems, including binary, octal, decimal, and hexadecimal, along with methods for converting between these bases. It covers various categories of conversions, including decimal to any base, any base to decimal, and any base to any base, with examples for each. Additionally, it discusses signed magnitude forms, complements, error detection methods like parity and Hamming code, and introduces basic concepts of Boolean algebra.

Uploaded by

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

Number System

Base or Radix

• Binary 2

• Octal 8

• Decimal 10

• Hexadecimal 16
Number System Conversion
• Category 1: Decimal to Any Base

• Category 2: Any Base to Decimal

• Category 3: Any Base to Any Base (Excluding upper 2 categories)


Category 1: Decimal to Any Base

Follow Repeated Division method

Case 1: Decimal to Binary ( Divide by 2)

Example:
Convert the decimal number 2610 into its binary equivalent.

 2610 = 110102
Dec → Binary : More Examples
a) 1310 = ?

b) 2210 = ?

c) 4310 = ?

d) 15810 = ?

5
Dec → Binary : More Examples
a) 1310 = ? 11012

b) 2210 = ? 101102

c) 4310 = ? 1010112

d) 15810 = ? 100111102

6
Category 1: Decimal to Any Base

Follow Repeated Division method

Case 2: Decimal to Octal (Divide by 8)

Example:
Convert the decimal number 2610 into its Octal equivalent.

 2610 = 328
Dec → Octal : More Examples
a) 1310 = ?

b) 2210 = ?

c) 4310 = ?

d) 15610 = ?

8
Category 1: Decimal to Any Base

Follow Repeated Division method

Case 3: Decimal to Hexadecimal (Divide by 16)

Example:
Convert the decimal number 2610 into its Hexadecimal equivalent.

 2610 = 1A16
Dec → Hexadecimal : More
Examples
a) 1310 = ?

b) 2210 = ?

c) 4310 = ?

d) 15610 = ?

10
Category 2: Any Base to Decimal

Follow Repeated Multiplication method

Case 1: Binary to Decimal ( Multiply by Weights of binary system)

Example:
Convert the Binary number 110102 into its decimal equivalent.

 110102 = 2610
Bin → Decimal : More Examples

11012 =
1 0 1 1 0 2=

1010112 =

100111102 =

12
Category 2: Any Base to Decimal

Follow Repeated Multiplication method

Case 2: Octal to Decimal ( Multiply by Weights of octal system)

Example:
Convert the Octal number 328 into its decimal equivalent.

 328 = 2610
Octal → Decimal : More Examples

11 8 =
16 8=

24 8 =

568 =

14
Category 2: Any Base to Decimal

Follow Repeated Multiplication method

Case 3: Hexadecimal to Decimal ( Multiply by Weights of Hex system)

Example:
Convert the Octal number 1A16 into its decimal equivalent.

 1A16 = 2610
Hexadecimal → Dec : More
Examples
a) 2316 = ?

b) 5B16 = ?

c) 4A16 = ?

d) 15616 = ?

16
Category 3: Any Base to Any Base
(Excluding Category 1 & 2 cases)

Case 1: Binary to Octal


Case 2: Octal to Binary Examples::

Case 3: Binary to Hexadecimal


Case 4: Hexadecimal to Binary

Case 5: Hexadecimal to Octal


Case 6: Octal to Hexadecimal
Practice Problems
Practice Problems
Example 1:
(234)7 = ( ? )5
Solution:
Convert (234)7 = ( )10 Then Convert ( )10 = ( )5
Solution: (443)5
Example 2:
(345)7 = ( ? )5
Solution: (1210)5

Example 3:
(224)5 = ( ? )7
Solution: (121)7
Number System Conversions
• Convert (0.3125)10 into its binary equivalent.
Number System Conversions
• Convert (0.3125)10 into its octal equivalent.
Number System Conversions
• Convert (0.3125)10 into its hexadecimal equivalent.
Signed Magnitude Form
Left Most Bit in a signed number is Sign Bit

0 Sign Bit Means “Positive number”


1 Sign Bit Means “Negative number”
Complement Arithmetic

• Complements are used in the digital computers in order to simplify


the subtraction operation and for the logical manipulations.
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
Practice Problems
Octal system complements

7’s complement & 8’s complement


Decimal system complements

9’s complement & 10’s complement


Hexadecimal system
complements
15’s complement & 16’s complement
8’s complement of (342)8
a) (546)8
b) (547)8
c) (435)8
d) (436)8
8’s Complement of (560)8
a) (217)8
b) (220)8
c) (218)8
d) (221)8
r-1 Complement of Hex Number
(5A3)
a) A5D
b) A6C
c) A5C
d) A6D
Hexadecimal Addition
Examples
Practice
Practice:: Hexadecimal Subtraction

Solution::

a)

b)
Subtraction using Complements
Rules::

For “r-1” complement For “r” complement

If no carry generated  Result is negative If no carry generated  Result is negative


and take its “r-1” complement again and take its “r” complement again

If carry generated  Result is positive and If carry generated  Result is positive and
add the carry to least significant position discard carry
Examples
CODES

Numeric Code Alpha-Numeric Code

Weighted Code Non-weighted Code ASCII Code (7 bit)

Positive Negative Gray Code

8421 Code 631-1 Code Excess-3 Code

2421 Code
CODES
Dec. 8421 2421 631-1 Excess-3
(BCD code) (Self complementary) (Self complementary) (Add 3 to BCD)
0 0000 0000 0000; 0011 0011
1 0001 0010
0001 0100
2
0010; 1000 0101
0010 0101
0011; 1001 0100; 0111
3 0011 0110
0100; 1010 0110
4 0100 0111
0101; 1011 1001
5 0101 1000
0110; 1100 1000; 1011
6 0110 0111; 1101 1010 1001
7 0111 1110 1101 1010
8 1000 1111 1111; 1100 1011
9
1001 1100
BCD Code
• It is a way to express each of the Decimal Digits with a Binary Code

• There are only Ten groups possible in BCD System


Examples
BCD Addition
Examples
Practice problems
0011 1001 + 1000 1000 , Perform
BCD Addition.
Gray Code
• It’s a non-weighted code.

• Only 1 Bit change in consecutive sequence.

• Used in K-Map as an application


Binary to Gray code conversion

Binary  1 0 1 1 0

Gray 
Convert Binary into Gray Codes

Decimal Binary Gray


3 bit binary to gray code converter
Gray To Binary code conversion

Gray  1 0 1 1 0

Binary 
Gray Code Sequence: 2 bit, 3 Bit, 4
Bit
Error Detection & Correction Method
• Parity Method
• Hamming Code
What is Parity???
• It is concept of detecting error.

• A single bit error is detected by Parity Method

Tx Rx

• We need to add 1 extra bit (i.e. Parity Bit) along with the original information.
Types
Even parity Odd Parity

• In case of Even Parity


Total No. of 1’s should be Even (including data bits and parity bit)

• In case of Odd Parity


Total No. of 1’s should be Odd (including data bits and parity bit)
Identify the Parity Bit for following
cases

Decimal BCD Parity Bit??


0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
Hamming Code (Error Correction
code)
• Used to detect 1 bit error

• Also tells the position of the bit in error.


1 2 3 4
Steps No. of Parity
Bits
Placement of
Parity Bits
Value of Parity
Bits
Construction of
Hamming Code
Step1: No. of Parity Bits

2P≥P+n+1

Where P -> No. of Parity Bits


n -> No. of Data Bits
Step 2: Placement of Parity Bits

Parity Bits are having reserved positions as per Ascending Power of 2.

7 6 5 4 3 2 1

D3 D2 D1 P3 D0 P2 P1

D3 D2 D1 D0
MSB LSB
Step 3: Value of Parity Bits

P1 – 3,5,7
P2 – 3,6,7
P3 – 5,6,7

7 6 5 4 3 2 1

D3 D2 D1 P3 D0 P2 P1
7 6 5 4 3 2 1

D3 D2 D1 P3 D0 P2 P1
Create Hamming code for Data bits
10110 using odd parity.
BOOLEAN ALGEBRA & BOOLEAN
EXPRESSIONS
AND Gate- Application
Practice Questions
Identify the logic gate from Timing
Diagram
Laws of Boolean Algebra
• Commutative Law
• Associative Law
Rules of Boolean Algebra
Verification of Rule 11
Verification of Rule 12
Demorgan’s Theorems
• First Theorem::
Demorgan’s Theorems
• Second Theorem::
Practice Problems
Practice Problems
Solution
Boolean Expression
Constructing Truth Table for Boolean expression
Hardware Reduction
Homework

You might also like