Decimal and Binary Numbers
Decimal numbers
Decimal numbers are the numbers we commonly use in our everyday life, based on the decimal system, which uses a base of 10. It consists of ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. The value of each digit depends on its position in the number. For example, in the number 357, the digit 3 is in the hundreds place, the digit 5 is in the tens place, and the digit 7 is in the ones place.
Binary numbers
Binary numbers, on the other hand, are numbers represented using the binary system, which has a base of 2. It consists of only two digits: 0 and 1. Each digit in a binary number is called a bit. The value of each bit also depends on its position in the number. In binary, the rightmost bit represents the ones place, the next bit represents the twos place, the next represents the fours place, and so on, doubling in value as we move to the left.
Converting decimal numbers to binary
Converting decimal numbers to binary involves dividing the decimal number by 2 repeatedly and noting the remainders until we reach 0. The binary representation is obtained by reading the remainders in reverse order. For example, to convert the decimal number 10 to binary:
10 ÷ 2 = 5 remainder 0 5 ÷ 2 = 2 remainder 1 2 ÷ 2 = 1 remainder 0 1 ÷ 2 = 0 remainder 1
The remainders in reverse order are 1010, so the binary representation of 10 is 1010.
Conversely, converting binary numbers to decimal involves multiplying each bit by the corresponding power of 2 and summing up the results. For example, to convert the binary number 1010 to decimal:
1 × 2^3 = 8 0 × 2^2 = 0 1 × 2^1 = 2 0 × 2^0 = 0
Adding up the results: 8 + 0 + 2 + 0 = 10. So, the decimal representation of 1010 is 10.
Binary numbers are commonly used in computing and digital systems because they can represent data and information using only two states (0 and 1). Decimal numbers, on the other hand, are used in most human-centric applications for ease of understanding and representation.
Example usage of Binary Numbers
A few examples of how decimal and binary numbers are used in different contexts:
- Computing and Programming: In computer systems, binary numbers are used extensively. Processors, memory, and other computer components represent and manipulate data using binary. For example, when writing computer programs, you may work with binary numbers to perform bitwise operations, manipulate binary data, or optimize algorithms for efficiency.
- Networking and IP Addresses: In networking, IP addresses are represented using binary numbers. An IP address is a unique identifier assigned to devices on a network. IPv4 addresses, the most commonly used format, consist of four sets of eight binary digits (bits) each, separated by periods. For example, the decimal IP address “192.168.0.1” can be represented in binary as “11000000.10101000.00000000.00000001”.
- Digital Storage: Binary numbers are used to represent data in digital storage devices like hard drives, solid-state drives (SSDs), and memory cards. Storage capacity is typically measured in bytes, where each byte consists of eight bits. For example, a 1 terabyte (TB) hard drive can store approximately 1 trillion binary digits (or bits) of data.
- Data Transmission and Telecommunications: Binary numbers are fundamental in data transmission and telecommunications systems. Communication protocols, such as Ethernet and wireless standards, transmit data in the form of binary signals (0s and 1s). These binary signals are encoded and modulated to represent information like voice, video, and text, allowing it to be transmitted over networks or through different media.
- Financial Calculations: Decimal numbers are widely used in financial calculations and representations. Monetary values, interest rates, exchange rates, and other financial data are typically expressed in decimal form. Decimal arithmetic is used in financial calculations such as interest calculations, currency conversions, investment analyses, and accounting.
These examples demonstrate how decimal and binary numbers play crucial roles in various fields, ranging from computing and telecommunications to finance and data storage.
Question:
Write down the binary 36-bit pattern to represent -1.5625 x 10^-1 assuming the leftmost 12 bits as the exponent stored as a two’s complement number, and the righmost 24 bits are the fraction stored as a two’s complement number. No hidden 1 is used. Show all the steps of your solution
Answer :
To represent -1.5625 × 10^-1 in binary using a 36-bit pattern with the leftmost 12 bits as the exponent and the rightmost 24 bits as the fraction (both stored as two’s complement numbers), we can break it down as follows:
- Converting the absolute value of the number to binary: The absolute value of -1.5625 × 10^-1 is 1.5625 × 10^-1.First, convert the integer part: 1 ÷ 2 = 0 remainder 1 (LSB)Then, convert the fractional part by multiplying by 2 repeatedly: 0.5625 × 2 = 1.125 (Take the integer part) 0.125 × 2 = 0.25 (Take the integer part) 0.25 × 2 = 0.5 (Take the integer part) 0.5 × 2 = 1 (Take the integer part)Combining the integer parts obtained in reverse order: 0.1001 (fractional part)Therefore, the absolute value of -1.5625 × 10^-1 in binary is 1.1001.
- Converting the exponent to binary using two’s complement: The exponent -1 needs to be represented in binary using a 12-bit pattern.Converting -1 to binary: 000000000001 (12 bits)To obtain the two’s complement representation, we need to invert all the bits and add 1: 000000000001 (original) 111111111110 (inverted) 111111111111 (add 1)Therefore, the two’s complement of -1 in 12 bits is 111111111111.
- Combining the exponent and fractional part: The leftmost 12 bits are reserved for the exponent, and the rightmost 24 bits are reserved for the fraction.Exponent: 111111111111 Fraction: 0000000000000000000000001001Combining the exponent and fraction: 11111111111100000000000000000000000000001001This is the binary 36-bit pattern that represents -1.5625 × 10^-1 using a two’s complement representation, with the leftmost 12 bits representing the exponent and the rightmost 24 bits representing the fraction.
The binary 36-bit pattern that represents -1.5625 × 10^-1 in two’s complement representation, with the leftmost 12 bits as the exponent and the rightmost 24 bits as the fraction, is 11111111111100000000000000000000000000001001.
[…] Introduction to Annuities […]