1.03 - Internal coding of numbers Flashcards
Define the sign and magnitute representation
It is a signed integer that has a binary code of the value (Magnitude) and an extra bit to define the sign (Sign)
0 is (+) and 1 is (-)
Why are signed integers usually in two’s complement form?
Because there are a lot of disadvantages in using signed integers.
Define the one’s complement of a binary number
It is defined as the binary number obtained if each binary digit is individually substracted by 1. This means that each 0 is switched to 1 and 1 to 0 (Flip)
Define the two’s complement form
It is defined as the binary number obtained if 1 is added to the one’s complement form
Explain the quicker method to convert binary to two’s complement form
First, start from the right and move to the left ignoring any 0s up to the first 1 which will also be ignored.
Then flip the remaining bits (0 to 1/ 1 to 0)
How to convert (+) denary number to its two complement binary form?
- Convert denary value to binary
- Add a 0 infront of this binary value
How to convert a (-) denary value into its two’s complement binary form?
- Disreagard the sign and convert to binary
- Add 0 infront of this binary value
- Convert binary value into two’s complement form
How to convert a two’s complement binary value into a (+) denary value?
The leading zero is ignored and the remaining is converted to denary
How to convert a two’s complement binary value into a (-) denary value?
Convert the binary value into denary the usual way but treat the most significant bit as a negative
What are the rules for the addition of binary digits?
- 0 + 0 = 0
- 0 + 1 = 1
- 1 + 1 = 0 (carry of 1)
- 1 + 1 + 0 = 0 (carry of 1)
- 1 + 1 + 1 = 1 (carry of 1)
What are the rules for the substraction of binary digits?
- 0 - 0 = 0
- 0 - 1 = 1 (after a borrow)
- 1 - 0 = 1
- 1 - 1 = 0
What is the meaning of overflow?
It means the value that has been produced is too large to be stored.
An advantage of using two’s complement form
It simplifies the process of substracting one number from another. The number being substracted in converted to its two’s complement form which is then added to the other number
What is the use of the binary coded decimal (BCD) scheme?
It is useful in applications that require a single denary digit to be stored or transmitted
How does a BCD code represent a denary digit?
Using a nibble