Вы находитесь на странице: 1из 20

Number Systems Conversions

and Arithmetic
CoENG001L
Midterm Lecture 2
by: Engr. Ricrey E. Marquez, CpE, MSCS
 After this lecture, student should be able:

◦ To convert different number system into another number


system that essential in digital design, and

◦ To calculate different number system.

Lecture Objectives
 Base or radix – the number of digits (basic symbols) in a
manner system
 Bit – an abbreviation for binary numbers
 Byte – a string of 8 bits and it is the basic unit of binary
information
 Chunking - a process of replacing a longer string of binary
numbers by a shorter one
 Data – refers to a names, numbers, and any other
information needed to solve a problem
 Digital – pertains to anything in the form of digits.
 Double Word – a string of 32 bits or 4 bytes
 Nibble – a string of 4 bits or half a byte
 Quad Word - a string of 64 bits or 8 bytes
 String – a group of digits or symbols
 Word – a string of 16 bits or 2 bytes

Terms to Remember
Number Systems Conversions and Arithmetic
These are given in a notation of Nr or Nb; where
N is the numerical value of the number system,
and r/b is radix/base of the number system.
Radix/ Radix/
Number System Number System
Base Base
Binary 2 Decimal 10
Ternary 3 Undinary 11
Quarternary 4 Duodenary 12
Quinary 5 Trendary 13
Senary 6 Quatrodinary 14
Sepnary 7 Quindinary 15
Octal 8 Hexadecimal 16
Nonary 9  
Number System Conversions
Number Systems Conversions and Arithmetic
C1- Conversion from decimal to any
number system

1. Divide the decimal number by the base


(required) of the desired number system;
2. Multiply the quotient by the divisor(required
base);
3. Subtract the product of step 2 from the given
number to get the remainder;
4. Repeat steps 1, 2, and 3 until the
number(quotient) become zero;
5. Develop the answer from the remainder by
reading upward.
Number System Conversions
Number Systems Conversions and Arithmetic
C2- Conversion of fractional decimal number to any
number system

1. Multiply the decimal fraction by the required base of the desired


number system;
2. If the product shows on the overflow, write the overflow
otherwise zero;
3. Repeat steps 1 and 2 until number become zero or desired
position is obtained (four decimal point);
4. Develop your answer (whole number only) by reading from top
to bottom.

◦ Examples:

a) 1237.8125  N11
b) 2679.1436  N5
c) 7615.1234  N15

Number System Conversions


Number Systems Conversions and Arithmetic
C3 - Conversion from any number
system to decimal number

1. Multiple each digit by its positional value;


2. Add the products of digits and its positional
value
 
◦ Examples:

a) 2A56.1313  N10
b) ECE3.BE16  N10
c) EAC0.ACE15  N10

Number System Conversions


Number Systems Conversions and Arithmetic
C4 - Conversion from any number system
(not decimal) to any number system (not
decimal)

1. Convert the number system to decimal using


conversion III steps;
2. Convert decimal number result in step 1 to the desired
number system using conversion I & II steps.

◦ Examples:

a) 2A56.1311  N6
b) B234.AC13  N14
c) ABCD.EB15  N9

Number System Conversions


Number Systems Conversions and Arithmetic
C5 - Conversion of Binary to
HEXADECIMA BINAR
Octal DECIMAL OCTAL
L Y
◦ Divide binary digit into 3 bits from 0 0 0 0000
right to left (whole number) and 1 1 1 0001
left to right (decimal) then get
2 2 2 0010
equivalent octal number
3 3 3 0011
C6 4 4 4 0100
- Conversion of Binary to
5 5 5 0101
Hexadecimal
6 6 6 0110
◦ Divide binary digit into 4 bits
(nibble) from right to left (whole 7 7 7 0111
number) and left to right 8 10 8 1000
(decimal) then get equivalent 9 11 9 1001
hexadecimal number 10 12 A 1010
11 13 B 1011
◦ Examples 12 14 C 1100
13 15 D 1101
a. 10101111110.1002  N8; N16; N10
14 16 E 1110
b. 34573.12348  N2; N16; N10
15 17 F 1111
c. EEAC0.BAD16  N2; N8; N10

Number System Conversions


Number Systems Conversions and Arithmetic
Number System Arithmetic
Part II
Number System Addition
1. 101111000.10012 + 1001001.101112 +
100100.00012 = N2
2. 1234.567 + 345.768 + 2C.AB316 = N16
3. 10110.10002 + 4EE.4C0E16 + 357.7638 = N13

Number System Subtraction


(unsigned (non-negative) number)
1. 11001.110012 – 1101.10110112 = N2
2. ADC.DCA15 – 267.38 – 54.128 = N11

Number System Addition


Introduction to Digital Design and Number Systems
Number System Multiplication
1. 101111000.10012 x 1101.10102 = N10
2. 123.568 x 2C.AB316 = N16
3. 4EE.4C0E15 x 5.269 = N9

Number System Division


1. 101001.110012 /1011.101112 = N7
2. ADC.DCA15 / 2C.AD14= N14

Number System Addition


Number Systems Conversions and Arithmetic
Complements
Part III
Complements

◦ These are used in digital computers for simplifying the


subtraction operation and for logical manipulation.

◦ Two types of Complements for each base-r


system
 r’s complements – 2’s or 10’s complements
 (r-1)’s complements – 1’s or 9’s complements

◦ Note: When the value of the base is substituted, the


two types receive the names 2’s and 1’s complement
for binary numbers respectively, or 10’s and 9’s
complement for decimal numbers respectively.

Complements
Number Systems Conversions and Arithmetic
r’s Complements

◦ Given a positive numbers N in base r with an


integer part of n digits, the r’s complement of
N is defined as rn – N for N  0 and 0 for N =
0
◦ r’s of N = rn – N,

◦ where:

◦ r is the number base or radix


◦ n is the total of whole number digits, and
◦ N is the given number

r’s Complements
Number Systems Conversions and Arithmetic
 (r-1)’s Complements

◦ Given a positive numbers N in base r with an integer


part of n digits, the r’s complement of N is defined as rn
– r-m – N for N  0 and 0 for N = 0

◦ (r-1)’s of N = rn – r–m - N,

◦ where:

◦ r is the number base or radix


◦ n is the total counts of whole number digits,
◦ m is the total counts of fractional (decimal point)
number digits , and
◦ N is the given number

(r-1)’s Complements
Number Systems Conversions and Arithmetic
Examples:

a) Given 52520.360, find: a) 10’s of N, and b)9’s


of N.

b) Determine the a) 2’s of N, and b) 1’s of N; if N


= 101100.01102.

c) Find a) 4’s of N, b) 5’s of N; if N = 4321.1235.

Complements
Number Systems Conversions and Arithmetic
Subtractionof two positive numbers
(M - N), both base r, may done as
follows:

1. Add the minuend (M) to the r’s complements


of the subtrahend (N);
2. Inspect the results obtained in step 1 for an
end carry (EC):
 If an EC occurs, remove it.
 If an EC does not occurs, take the r’s complement
of the result obtained in the step 1 and place a
negative (-) sign in front or put binary 1 for binary
number.

Subtraction with r’s Complement


Number Systems Conversions and Arithmetic
Subtraction of two positive numbers (M
- N), both base r, may done as follows:

1. Add the minuend (M) to the (r – 1) ’s


complements of the subtrahend (N);
2. Inspect the results obtained in step 1 for an
end carry (EC):
 If an EC occurs, add 1 to the least significant digit
(LSD) aka. end-around carry (EAC).
 If an EC does not occurs, take the (r – 1)’s
complement of the result obtained in the step 1 and
place a negative (-) sign in front or put binary 1 for
binary number.

Subtraction with (r-1)’s Complement


Number Systems Conversions and Arithmetic
Examples

1. Using 10’s & 9’s complement, subtract 72532


- 3250
2. Using 10’s & 9’s complement, subtract 3250 –
72532
3. Using 2’s & 1’s complement, subtract
1010100.11012 – 1000100.11102
4. Using 2’s & 1’s complement, subtract
1000100.0012 – 1010100.1102

Subtraction with r’s and (r-1)’s Complement


Number Systems Conversions and Arithmetic

Вам также может понравиться