Number Systems and Data Representation in Computers
Number Systems notes for competitive exams: binary, octal and hexadecimal conversions, bits, bytes and storage units, ASCII, EBCDIC, BCD, Unicode and complements.
By GK24 Editorial Team· Published · 5 min read

Every piece of information inside a computer, whether it is a letter you type, a photograph, a song or an instruction of a program, is finally stored as a pattern of two states: current flowing or not flowing, magnetised or not magnetised, a pit or a land on a disc. That is why the machine counts in the binary number system instead of the decimal system people use. This chapter explains how the decimal number 25 becomes 11001, how eight such digits make one byte, and how the letter A becomes the number 65 inside memory. Examiners in SSC, Railway and Banking papers set questions from it every year because a single conversion can be asked and marked in one line.
Base, radix and positional value
A number system is defined by its base, also called its radix, which is simply the count of different digits it uses. The decimal system has base 10 because it uses ten digits, 0 to 9. In every positional system the value of a digit depends on the place it occupies, and each place is worth the base raised to a power that grows from right to left, beginning at zero. In decimal 345 the 3 stands for 3 x 10², the 4 for 4 x 10¹ and the 5 for 5 x 10⁰. The same rule works in every base. The binary number 1011 therefore means 1 x 2³ + 0 x 2² + 1 x 2¹ + 1 x 2⁰, which is 11 in decimal. One fact settles many objective questions: the largest digit of a system is always one less than its base, so 8 and 9 can never appear in an octal number.
The four number systems used in computing
| System | Base | Digits used | Example |
|---|---|---|---|
| Binary | 2 | 0, 1 | 1011 |
| Octal | 8 | 0 to 7 | 627 |
| Decimal | 10 | 0 to 9 | 345 |
| Hexadecimal | 16 | 0 to 9 and A to F | 2AF |
Hexadecimal borrows the letters A, B, C, D, E and F to stand for the decimal values 10, 11, 12, 13, 14 and 15, because no single symbol exists for them. Octal and hexadecimal are used as shorthand: they pack long strings of bits into a few readable characters, which is why memory addresses and colour codes are written in hexadecimal.
Converting from one system to another
- Decimal to binary: divide the number by 2 again and again, note each remainder, and read the remainders from the bottom upwards. Dividing 25 gives remainders 1, 0, 0, 1, 1, so 25 is 11001.
- Binary to decimal: multiply each bit by its place value and add. For 11001 that is 16 + 8 + 0 + 0 + 1, again 25.
- Binary to octal: make groups of three bits from the right and write the decimal value of each group, because 2³ equals 8. So 110 010 111 becomes 627.
- Binary to hexadecimal: make groups of four bits from the right, because 2⁴ equals 16. So 1110 becomes E.
- Octal to hexadecimal: there is no direct method worth remembering; expand the octal number into binary, regroup the bits in fours and read the hexadecimal digits.
Bit, byte and the units of storage
A bit, short for binary digit, is one 0 or one 1 and is the smallest unit of data. Four bits make a nibble and eight bits make a byte, the unit in which one character is normally stored. Larger units go up in steps of 2¹⁰, that is 1024, and not 1000, which is the trap examiners use.
| Unit | Equals | In bytes |
|---|---|---|
| Nibble | 4 bits | Half a byte |
| Byte | 8 bits | 1 |
| Kilobyte (KB) | 1024 bytes | 2¹⁰ |
| Megabyte (MB) | 1024 KB | 2²⁰ |
| Gigabyte (GB) | 1024 MB | 2³⁰ |
| Terabyte (TB) | 1024 GB | 2⁴⁰ |
How characters and pictures are coded
Numbers are stored in binary directly, but letters and symbols need a code that fixes which pattern of bits stands for which character. Standard ASCII, the American Standard Code for Information Interchange, uses seven bits and therefore covers 128 characters; the capital letter A is 65, the small letter a is 97 and the digit character 0 is 48. Extended ASCII adds an eighth bit and reaches 256 characters. EBCDIC, an eight-bit code from IBM, was used on mainframes. BCD, or Binary Coded Decimal, stores each decimal digit separately in four bits, so 25 is written 0010 0101. Unicode was created so that every script in the world, Devanagari included, could be represented; its first 128 code points are the same as ASCII, which keeps old files readable. A picture is stored as a grid of pixels, each pixel holding the intensity of red, green and blue, and a sound as thousands of numbered samples per second.
Binary arithmetic and complements
Binary addition follows four rules: 0 + 0 is 0, 0 + 1 is 1, 1 + 0 is 1, and 1 + 1 is 0 with a carry of 1. Subtraction is usually not done directly; computers turn it into addition using complements. The 1's complement of a binary number is obtained by changing every 0 to 1 and every 1 to 0. The 2's complement is the 1's complement plus one, and it is the standard way of storing negative numbers, because the same adder circuit then handles both addition and subtraction. In a signed binary number the leftmost bit, called the most significant bit, is the sign bit: 0 marks a positive number and 1 a negative one. An unsigned group of eight bits can hold the values 0 to 255, since 2⁸ is 256.
Exam Point of View
Examiners ask five things from this chapter. First, straight conversions: decimal to binary, binary to octal in groups of three and binary to hexadecimal in groups of four. Second, the base and the allowed digits, usually as a question asking which number is not a valid octal or binary number. Third, the units, where the trap is answering 1000 instead of 1024 for a kilobyte, and confusing nibble with byte. Fourth, the coding schemes: the bit width of ASCII, EBCDIC and Unicode, the number of characters each covers, and the ASCII values of A, a and 0. Fifth, complements, where candidates take the 1's complement and forget to add one. Expect one question from this chapter in almost every Computer Awareness section, and check whether the question wants the count of patterns, which is 256, or the largest value, which is 255.
Important Facts
| Base of binary | 2, using only the digits 0 and 1 |
|---|---|
| Base of octal | 8, using the digits 0 to 7 |
| Base of hexadecimal | 16, using 0 to 9 and A to F |
| Value of hexadecimal A to F | 10, 11, 12, 13, 14 and 15 |
| Nibble | 4 bits, half a byte |
| Byte | 8 bits, normally one character |
| One kilobyte | 1024 bytes, that is 2 raised to the power 10 |
| Standard ASCII | 7-bit code, 128 characters |
| Extended ASCII and EBCDIC | 8-bit codes, 256 characters; EBCDIC is from IBM |
| ASCII value of A, a and 0 | 65, 97 and 48 |
| Bits per octal and hexadecimal digit | 3 bits and 4 bits |
| 2's complement | 1's complement plus one |
| Range of an unsigned byte | 0 to 255, since 2 raised to the power 8 is 256 |
| Sign bit | The most significant bit; 0 for positive, 1 for negative |
Practice MCQs on this topic
What is the hexadecimal equivalent of this binary number (1110)2?
- A.F
- B.B
- C.A
- D.E
Show answer
Hexadecimal has base 16, and because 2 raised to the power 4 equals 16, exactly four binary bits make one hexadecimal digit.
Read the full explanation →The binary equivalent of octal number 627 is:
- A.111010110
- B.110010110
- C.110010111
- D.011010111
Show answer
Octal has base 8, and because 2 raised to the power 3 equals 8, every octal digit expands into exactly three binary bits.
Read the full explanation →(1101 0001)2 binary number is same as which octal number?
- A.(321)8
- B.(123)8
- C.(641)8
- D.(146)8
Show answer
To turn a binary number into octal, group the bits in threes starting from the rightmost bit, adding leading zeros to complete the last group, because three bits cover the eight octal digits.
Read the full explanation →The difference between the two binary numbers 10010000 and 1111001 is:
- A.11101
- B.11011
- C.10111
- D.10011
Show answer
The safest way to handle a binary subtraction in an examination is to convert both numbers to decimal, subtract, and convert the answer back.
Read the full explanation →How many bits make one nibble?
- A.2
- B.4
- C.8
- D.16
Show answer
A bit, short for binary digit, is a single 0 or 1 and is the smallest unit of data a computer handles.
Read the full explanation →One kilobyte (KB) is exactly equal to how many bytes?
- A.1000
- B.1024
- C.2048
- D.512
Show answer
Storage units in computing grow in powers of two rather than powers of ten, because addresses are binary. One kilobyte is 2 raised to the power 10 bytes, which equals 1024 bytes.
Read the full explanation →Which of the following is NOT a valid octal number?
- A.377
- B.128
- C.745
- D.66
Show answer
The octal system has base 8, so it uses only the eight digits from 0 to 7. The general rule is that the largest digit of any number system is one less than its base, which means the digits 8 and 9 can never appear in an octal number.
Read the full explanation →The decimal equivalent of the binary number 11001 is:
- A.21
- B.23
- C.25
- D.27
Show answer
To convert a binary number to decimal, write the place values from the right as 1, 2, 4, 8, 16 and so on, multiply each bit by its place value and add the results.
Read the full explanation →Standard ASCII uses how many bits to represent one character?
- A.6
- B.7
- C.8
- D.16
Show answer
ASCII stands for American Standard Code for Information Interchange. In its standard form it is a seven-bit code, so it can represent 2 raised to the power 7, that is 128 different characters: the English capital and small letters, the ten digit symbols, punctuation marks and a set of control…
Read the full explanation →The 2's complement of the binary number 1010 is:
- A.0101
- B.0110
- C.1011
- D.1001
Show answer
The 2's complement is found in two steps. First take the 1's complement by changing every 0 to 1 and every 1 to 0; for 1010 this gives 0101.
Read the full explanation →In the hexadecimal system, the symbol D stands for which decimal value?
- A.11
- B.12
- C.13
- D.14
Show answer
Hexadecimal has base 16 and therefore needs sixteen different symbols. The digits 0 to 9 serve for the first ten values, and because no single digit exists for the values 10 to 15, the letters A to F are borrowed.
Read the full explanation →What is the largest unsigned decimal number that can be stored in one byte?
- A.127
- B.128
- C.255
- D.256
Show answer
One byte holds eight bits, and each bit can be either 0 or 1, so the number of different patterns is 2 raised to the power 8, that is 256.
Read the full explanation →Frequently Asked Questions
Why do computers use the binary number system?
A digital circuit can reliably tell apart only two states, such as a voltage being present or absent, or a spot on a disc being magnetised or not. Two states map naturally onto the two digits 0 and 1, so binary is the cheapest and least error-prone way to store and move data. A system with ten states would need ten different voltage levels and would misread them constantly.
How many bytes are there in one kilobyte, 1000 or 1024?
In computing a kilobyte is 1024 bytes, because memory is addressed in powers of two and 1024 is 2 raised to the power 10. The figure 1000 belongs to the decimal kilobyte used by disc manufacturers on packaging, which is why an advertised 500 GB disc shows less capacity on screen. In examinations, take one kilobyte as 1024 bytes.
What is the difference between ASCII and Unicode?
Standard ASCII is a seven-bit code with 128 characters and covers only English letters, digits, punctuation and control codes. Unicode was designed to hold every writing system in the world, including Devanagari, Tamil and Chinese, and gives each character a unique code point. The first 128 Unicode code points are identical to ASCII, so plain English text remains readable in both.
How do I convert a binary number to hexadecimal quickly?
Make groups of four bits starting from the rightmost bit, adding leading zeros to complete the last group, and replace each group by its hexadecimal symbol. The group 1110 becomes E and 1010 becomes A, so 10101110 becomes AE. The method works because four bits give sixteen combinations, exactly the number of hexadecimal symbols.
Why do computers store negative numbers in 2's complement form?
In 2's complement form, subtracting a number is the same as adding its complement, so the processor needs only one adder circuit instead of separate adding and subtracting hardware. It also gives a single pattern for zero, unlike the 1's complement method which has both a positive and a negative zero.
Sources
- Computer Science, Textbook for Class XI, Unit 1: Computer Systems and Organisation — NCERT
- The Unicode Standard, Chapter 2: General Structure — Unicode Consortium
- ANSI X3.4, Coded Character Set, 7-Bit American National Standard Code for Information Interchange — American National Standards Institute





