Download presentation
Presentation is loading. Please wait.
Published byElla Cummings Modified over 9 years ago
1
WEEK #2 NUMBER SYSTEMS, OPERATION & CODES (PART 1)
DKT 122/3 DIGITAL SYSTEM 1 WEEK #2 NUMBER SYSTEMS, OPERATION & CODES (PART 1)
2
Numbers & Codes Numbering Systems Number Conversion Binary Arithmetic
Decimal numbering system (Base 10) Binary numbering system (Base 2) Hexadecimal numbering system (Base 16) Octal numbering system (Base 8) Number Conversion Binary Arithmetic 1’s and 2’s Complements of Binary Numbers
3
Numbers & Codes (cont..) Signed Numbers Other Number Codes
Arithmetic Operations with Signed Numbers Other Number Codes Binary-Coded-Decimal (BCD) ASCII codes Gray codes Digital Codes & Parity
4
Numbering Systems Decimal Binary Octal Hexadecimal 0 ~ 9 0 ~ 1 0 ~ 7
(base 10) Binary (base 2) Octal (base 8) Hexadecimal (base 16) 0 ~ 9 0 ~ 1 0 ~ 7 0 ~ F
5
Num. Systems (Characteristics)
The digits are consecutive (berturutan). The number of digits is equal to the size of the base. Zero is always the first digit. When 1 is added to the largest digit, a sum of zero and a carry of one results. Numeric values determined by the implicit positional values of the digits.
6
Numbering Systems (Cont.)
A B C D E F Binary Octal Hex Dec
7
Numbering System (Decimal)
Also called the Base 10 system Have 10 digits : 0 9 The position for each digit in the decimal number indicates the magnitude of the quantity represented and can be assigned a weight
8
Numbering System (Decimal)
The weight for whole numbers are positive powers of ten that increase from right to left For fractional numbers, the weights are negative powers of ten that decrease from left to right …. Decimal point
9
Numbering System (Binary)
Also called the Base 2 system The binary number system is used to model the series of electrical signals computers use to represent information 0 represents the no voltage or an off state 1 represents the presence of voltage or an on state
10
“There are 10 kinds of mathematicians.
Just think for a while.. “There are 10 kinds of mathematicians. Those who can think binarily and those who can't...” So, what is the meaning of this? YOU FALL IN WHICH CATEGORY?
11
Significant Digits Binary: 11101101 Hexadecimal: 1D63A72A
Most significant digit (MSB) Least significant digit (LSB) Hexadecimal: 1D63A72A Question: How many bits does the numbers represent?
12
Number Conversion Any Radix (base) to Decimal Conversion
13
Binary to Decimal Conversion
Decimal value of any binary number can be found by adding weights of all bits that are 1 and discarding the weights of all bits that are 0
14
Solve this.. Convert the following binary numbers to decimal (a) 10102 Answer : ? (b) Answer : ? (c) Answer : ?
15
Decimal to Binary Conversion
For whole number conversion, use the repeated division-by-2 process and record the remainder For fractional number conversion, use repeated multiplication by 2 until the fractional product is 0 or until the desired number of decimal places is reached
16
Decimal to Binary Conversion
Remainder Whole number 2 5 = 2 1 2 = 6 = 3 = 1 = MSB LSB 2510 =
17
Decimal to Binary Conversion
Fractional number Carry x 2 = x 2 = x 2 = 0.5 x 2 = The Answer: MSB LSB
18
Solve this.. Convert the following decimal numbers to binary (a) 3910 Answer : ? (b) 5810 Answer : ? (c) Answer : ?
19
Binary Arithmetics Binary Addition Binary Subtraction Binary Multiplication Binary Division
20
Binary Addition Four basic rules for adding binary digits (bits) are:
0 + 0 = 0 (Sum of 0 with a carry of 0) 0 + 1 = 1 (Sum of 1 with a carry of 0) 1 + 0 = 1 (Sum of 1 with a carry of 0) 1 + 1 = 1 0 (Sum of 0 with a carry of 1)
21
Examples (a) 100 + 10 1 0 0 + 1 0 (Answer) 1 1 0 (b) 111 + 11 1 1 1 +
Perform the following binary additions: (a) 1 0 0 1 0 + 1 1 0 (Answer) (b) 1 1 1 + 1 1 (Answer)
22
Solve this.. Perform the following binary additions: (a) 11 + 01
Answer : ? (b) Answer : ? (c) : Answer : ?
23
Binary Arithmetics Binary Addition Binary Subtraction Binary Multiplication Binary Division
24
Binary Subtraction 0 - 0 = 0 1 - 1 = 0 1 - 0 = 1
Four basic rules for subtracting binary digits (bits) are: 0 - 0 = 0 1 - 1 = 0 1 - 0 = 1 = 1 (0 – 1 with a borrow of 1)
25
Examples (a) 101 – 011 1 0 1 - 0 1 1 (Answer) 0 1 0 (b) 110 – 101
Perform the following binary subtractions: (a) 101 – 011 1 0 1 0 1 1 - 0 1 0 (Answer) (b) 110 – 101 1 1 0 1 0 1 - 0 0 1 (Answer)
26
Solve this.. (a) 101 – 100 (b) 1110 - 11 (c) 1100 - 1001:
Perform the following binary subtractions (a) 101 – 100 Answer : ? (b) Answer : ? (c) : Answer : ?
27
Binary Arithmetics Binary Addition Binary Subtraction Binary Multiplication Binary Division
28
Binary Multiplication
Four basic rules for muliplying binary digits (bits) are: 0 x 0 = 0 0 x 1 = 0 1 x 0 = 0 1 x 1 = 1
29
Examples Multiply 111 and 101: 1 1 1 x 1 0 1 1 1 1 0 0 0 1 1 1
(Answer)
30
Solve this.. (a) 11 x 11: (b) 110 x 111: (c) 1101 x 1010: Answer : ?
31
Binary Arithmetics Binary Addition Binary Subtraction Binary Multiplication Binary Division
32
Binary Division Example: 1 0 (Answer) 1 1 1 1 0 1 1 0 0 0
Division in binary follows the same procedure as division in decimal Example: Perform the binary divisions of 110 11 1 0 (Answer) 1 1 1 1 0 1 1 0 0 0
33
Solve this.. Divide the binary numbers as indicated: (a) 100 10
Answer : ? (b) 1100 100: Answer : ?
34
1’s Complement Example: 1 1 0 1 0 0 1 0 1 Binary number
Changing all the 1s to 0s and all the 0s to 1s Example: Binary number ’s complement
35
Find the 1’s complements of the numbers
Step 1: Find the 1’s complements of the numbers Binary number ’s complement Step 2: Add ‘1’ to the 1’s complements ’s complement Add 1 ’s complement
36
Solve this.. Determine the 2’s complement of each binary number: (a) Answer : ? (b) Answer : ?
37
Signed Numbers Left most is the sign bit
0 is for positive, 1 is for negative Sign & magnitude = +25 sign bit magnitude bits
38
Sign-Magnitude Numbers
The left-most is the sign bit and the remaining bits are the magnitude bits … Sign bit 31 bits for magnitude 0 = positive 1 = negative
39
Signed Numbers (Cont.) 1’s complement
The negative number is the 1’s complement of the corresponding positive number Example +25 is So, -25 is 2’s complement The positive number – same as sign magnitude and 1’s complement The negative number is the 2’s complement of the corresponding positive number. +25 is So, -25 is
40
END Solve this.. Express +19 and -19 (as an 8-bit number) in
i. sign magnitude ii. 1’s complement iii. 2’s complement Answer : ? Answer : ? Answer : ? END
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.