Data Representation
Original Scanned PDF – View Notes
Data
- Data represent symbols that represent people, events, things and ideas.
- Data can be a name, a number, the color in a photograph or notes in a musical composition.
Data Representation
- It refers to the form in which data is stored, processed and transmitted.
- Devices such as smart phones, iPods and computers store data in digital format that can be handled by electronic circuit.
- The 0s and 1s are used to represent digital data.
- A bit is either ‘0’ or ‘1’.
- For representing number digital devices use binary number system.
- For representing Text, Digital devices use several type of coding technique like ASCII, unicode (16 bit).
ASCII
- ASCII (American Standard Code for Information Interchange) required 7 bit for each computer.
- The ASCII code for an uppercase A is
1000001. - Extended ASCII is a superset of ASCII that uses 8 bit for each other.
- Using 8 bit instead of 7 bit allows Extended ASCII to provide code for 256 character.
Unicode
Unicode using 16 bit and provide codes for 65000 character.
State Unit of Measurement in Computer
Bits and Bytes
- All of the data stored and transmitted by digital devices in encoded as bits.
- Bits and Bytes is used to describe storage capacity and network speed.
- Bit is denoted by
b. - A group of 8 bits is called a byte.
- It is denoted by
B.
| Unit | Value |
|---|---|
| Bit | One binary digit |
| Byte | 8 bits |
| Kilobit | 1024 or 210 bits |
| Kilobyte | 1024 or 210 bytes |
| Megabit | 1,048,576 or 220 bit |
| Megabyte | 1,048,576 or 220 bytes |
| Gigabit | 230 bits |
| Gigabyte | 230 bytes |
| Terabyte | 240 bytes |
| Petabyte | 250 bytes |
| Exabyte | 260 bytes |
- Uses bits for data rates such as internet connection speeds and movie download speeds.
- Uses bytes for files sizes and storage capacities.
Signed Number Representation
- A signed number is a number with positive (+) or negative (−) associated with it.
- In binary, signed number can be represented in three ways.
- Signed bit
- 1’s complement
- 2’s complement
1. Signed Bit
- The MSB (Most Significant Bit) represents the sign of the number.
- Magnitude is represented by other bit than MSB i.e (n−1).
- For −ve, MSB is ‘0’.
- For +ve, MSB is ‘1’.
Positive Number
| Sign | Magnitude | Decimal |
|---|---|---|
| 0 | 000 | +0 |
| 0 | 001 | +1 |
| 0 | 010 | +2 |
| 0 | 011 | +3 |
| 0 | 100 | +4 |
| 0 | 101 | +5 |
| 0 | 110 | +6 |
| 0 | 111 | +7 |
Negative Number
| Sign | Magnitude | Decimal |
|---|---|---|
| 1 | 000 | −0 |
| 1 | 001 | −1 |
| 1 | 010 | −2 |
| 1 | 011 | −3 |
| 1 | 100 | −4 |
| 1 | 101 | −5 |
| 1 | 110 | −6 |
| 1 | 111 | −7 |
2. 1’s Complement
A 1’s complement is a system in which negative numbers are represented by the inverse of the binary representation of their corresponding positive number.
In such a system, a number is negated (converted from positive to negative or vice versa) by computing its ones’ complement.
For positive numbers representation as same are signed bit.
For negative number 1’s complement of 0 is 1 and 1’s complement is 0.
Positive Number
| Sign | Magnitude | Decimal |
|---|---|---|
| 0 | 000 | +0 |
| 0 | 001 | +1 |
| 0 | 010 | +2 |
| 0 | 011 | +3 |
| 0 | 100 | +4 |
| 0 | 101 | +5 |
| 0 | 110 | +6 |
| 0 | 111 | +7 |
Negative Number
| Sign | Magnitude | Decimal |
|---|---|---|
| 1 | 111 | −0 |
| 1 | 110 | −1 |
| 1 | 101 | −2 |
| 1 | 100 | −3 |
| 1 | 011 | −4 |
| 1 | 010 | −5 |
| 1 | 001 | −6 |
| 1 | 000 | −7 |
3. 2’s Complement
- 2’s complement is a mathematical operation to reversibly convert a positive binary number into a negative binary number with equivalent value, using the binary digit with the greatest place value to indicate whether the binary number is positive or negative.
- For +ve numbers the representation rules are same as the signed bit.
- For −ve numbers, simply take 1’s complement and 1 to it.
Floating Point Representation
To convert the floating point into decimal we have 3 elements in a 32 bit floating point representation:
- Sign
- Exponent
- Mantissa
1. Sign
- It is the first bit of the binary representation.
- ‘1’ implies negative and ‘0’ implies positive number.
11000011101000000000000000000000
This is negative number.
2. Exponent
It is decided by next 8 bits of binary representation after sign bit.
3. Mantissa
- It is calculated from remaining 23 bits of binary representation.
- The general structure of a floating point representation of a binary number.
Example: Convert 111101.1000110 into floating value.
Ans. 111101.1000110 = 1.111011000110 × 25
Binary Coded Decimal (BCD)
- BCD is a process of binary encoding of decimal number.
- Each decimal digit is represented by using four or eight bit.
- The four bit BCD code for 0–9 decimal digit is given as:
| Decimal | Binary (BCD) |
|---|---|
| 0 | 0000 |
| 1 | 0001 |
| 2 | 0010 |
| 3 | 0011 |
| 4 | 0100 |
| 5 | 0101 |
| 6 | 0110 |
| 7 | 0111 |
| 8 | 1000 |
| 9 | 1001 |
Numbers larger than 9 have two or more digits in decimal system are expressed in digital by each digit.
Example: BCD representation of decimal number 1895 is
0001
81000
91001
50101
(1895)10 = (0001100010010101)2 = (1100010010101)2
Discussion
Share a helpful question, idea, or explanation with other students.