Negative and Fractional number representation
Representing Numbers
In decimal (base-10) notation, negative numbers are represented with a minus sign.
Examples:
- -8(a negative integer)
- -6.14 (a negative decimal number)
- -1/5 (a negative fraction)
- A sign bit of 0 represents a positive number.
- A sign bit of 1 represents a negative number.
Binary Representation
The binary number system is a base-2 numeral system that uses only two symbols: 0 and 1. Each digit in this system is referred to as a bit. Binary numbers are fundamental in computer science and digital electronics because they can be directly implemented in electronic circuits using logic gates.
Conversion from Decimal to Binary
To convert a decimal number to its binary equivalent, you repeatedly divide the number by 2 and record the remainders. The binary representation is obtained by reading the remainders in reverse order. For example, to convert the decimal number 13 to binary:
13 ÷ 2 = 6, remainder 1
6 ÷ 2 = 3, remainder 0
3 ÷ 2 = 1, remainder 1
1 ÷ 2 = 0, remainder 1
Reading the remainders from bottom to top, we get 1101. Therefore, 13 in binary is 1101.
Binary Arithmetic Operations
Binary arithmetic operations include addition, subtraction, multiplication, and division. These operations are similar to their decimal counterparts but are performed using binary digits.
Binary Addition
Binary addition follows these rules:
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 10 (which is 0 with a carry of 1)
Comments
Post a Comment