

































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


































Ministry of Higher Education Higher Technological Institute Computer Science Department Second level Course: - BSC 215 Lecturer: Dr. Ahmed Magdy Assistant teacher: Aya [email protected]
▪ Complement is used in digital computer for simplifying the subtraction operation and for logic implementation. There are two types of complements 1 ) (b- 1 )’s complements 2 ) b’s complements
▪ For binary numbers b = 2 , and b- 1 = 1 ▪ The 1 ’s complement of a binary number is obtained by subtracting each digit of the given number from 1. However, the subtraction of binary digit from 1 causes the bit to change from 1 to 0 or from 0 to 1.
▪ For octal numbers: b = 8 , and b- 1 = 7 ▪ The 7 ’s complement of an octal number is obtained by subtracting each digit of the given number from 7.
▪ Given a number N on base b having n digits, the b’s complement is defined as: ▪ Comparing with (b- 1 )’s complement, we note that the b’s complement is obtained by adding 1 to the (b- 1 )’s complement
▪ Rules for obtaining 10’s complement:
The number in the computer system can be either signed or unsigned number. Unsigned Number: ▪ The data format of 8 - bit unsigned number is shown in this figure. The 8 bits represents the magnitude of the number. ▪ For example the unsigned number ( 0 0 1 0 0 1 0 1 ) 2 is ( 37 ) 10
▪ If b 8 = 0 it means that the number is positive and if b 8 = 1 it means that the number is negative and its magnitude is represented by 3 ways.
▪ The negative number can represented in one of the following two systems
a) Binary addition: