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
Correct answer: D. E
Explanation
The correct answer is D, E. Hexadecimal has base 16, and because 2 raised to the power 4 equals 16, exactly four binary bits make one hexadecimal digit. The given number 1110 is already a group of four bits, so it converts in one step. Its place values are 8, 4, 2 and 1, and the bits are 1, 1, 1 and 0, so the decimal value is 8 + 4 + 2 + 0, that is 14. In hexadecimal the decimal values 10 to 15 are written as the letters A to F, so 10 is A, 11 is B, 12 is C, 13 is D, 14 is E and 15 is F. Fourteen is therefore E. Option A is wrong because F stands for 15, whose binary form is 1111. Option B is wrong because B stands for 11, that is 1011. Option C is wrong because A stands for 10, that is 1010.
The binary equivalent of octal number 627 is:
- A.111010110
- B.110010110
- C.110010111
- D.011010111
Show answer
Correct answer: C. 110010111
Explanation
The correct answer is C, 110010111. Octal has base 8, and because 2 raised to the power 3 equals 8, every octal digit expands into exactly three binary bits. Take the digits of 627 one at a time. The digit 6 becomes 110, the digit 2 becomes 010 and the digit 7 becomes 111. Writing them in the same order gives 110 010 111, that is 110010111. A quick check works the other way: grouping 110010111 in threes from the right gives 110, 010 and 111, which read back as 6, 2 and 7. Option A is wrong because 111010110 reads as 7, 2 and 6, which is octal 726. Option B is wrong because 110010110 ends in 110 and so reads as 626. Option D is wrong because 011010111 reads as 3, 2 and 7, that is octal 327.
(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
Correct answer: A. (321)8
Explanation
The correct answer is A, (321)8. 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. The number 11010001 splits into 11, 010 and 001, and the first group is written as 011. The group 011 has the value 3, the group 010 has the value 2 and the group 001 has the value 1, so the octal number is 321. Checking in decimal confirms it: 11010001 is 128 + 64 + 16 + 1, which equals 209, and octal 321 is 3 times 64 plus 2 times 8 plus 1, again 209. Option B is wrong because 123 is the same digits reversed. Option C is wrong because 641 would need the bits 110100001. Option D is wrong because 146 in octal equals 102 in decimal.
The difference between the two binary numbers 10010000 and 1111001 is:
- A.11101
- B.11011
- C.10111
- D.10011
Show answer
Correct answer: C. 10111
Explanation
The correct answer is C, 10111. The safest way to handle a binary subtraction in an examination is to convert both numbers to decimal, subtract, and convert the answer back. The first number 10010000 has ones in the places worth 128 and 16, so it equals 144. The second number 1111001 has ones in the places worth 64, 32, 16, 8 and 1, so it equals 121. The difference is 144 minus 121, which is 23. Now convert 23 to binary by repeated division by 2, which gives the remainders 1, 1, 1, 0 and 1 read upwards, that is 10111. Option A is wrong because 11101 equals 29. Option B is wrong because 11011 equals 27. Option D is wrong because 10011 equals 19. Only 10111 equals 23, so C is the answer.
How many bits make one nibble?
- A.2
- B.4
- C.8
- D.16
Show answer
Correct answer: B. 4
Explanation
The correct answer is B, 4. A bit, short for binary digit, is a single 0 or 1 and is the smallest unit of data a computer handles. Four bits together are called a nibble, which is exactly half of a byte, and the playful name comes from a nibble being a small bite. The nibble matters in practice because one hexadecimal digit is stored in exactly four bits, which is why hexadecimal is such a convenient shorthand for binary. Option A is wrong because two bits form no named unit and can represent only four combinations. Option C is wrong because eight bits make one byte, the unit in which a single character is normally stored. Option D is wrong because sixteen bits make two bytes, often called a word on older machines. Remember the ladder: bit, nibble of 4 bits, byte of 8 bits.
One kilobyte (KB) is exactly equal to how many bytes?
- A.1000
- B.1024
- C.2048
- D.512
Show answer
Correct answer: B. 1024
Explanation
The correct answer is B, 1024. 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. The same step of 1024 continues upward: 1024 kilobytes make one megabyte, 1024 megabytes make one gigabyte and 1024 gigabytes make one terabyte. Option A is wrong because 1000 bytes is the decimal kilobyte used by disc manufacturers in advertising, and it is exactly the trap this question sets. Option C is wrong because 2048 bytes is two kilobytes. Option D is wrong because 512 bytes is half a kilobyte, a figure students recall from the classic disc sector size. In competitive examinations always take one kilobyte as 1024 bytes unless the question itself says otherwise.
Which of the following is NOT a valid octal number?
- A.377
- B.128
- C.745
- D.66
Show answer
Correct answer: B. 128
Explanation
The correct answer is B, 128. 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. The number 128 contains the digit 8, so it cannot be an octal number, although it is a perfectly valid decimal or hexadecimal number. Option A is wrong as a choice because 377 uses only 3 and 7, both of which are allowed. Option C is wrong because 745 uses 7, 4 and 5, all below 8. Option D is wrong because 66 uses only the digit 6. Apply the same test to binary, where only 0 and 1 are allowed, and to hexadecimal, where 0 to 9 and A to F are allowed.
The decimal equivalent of the binary number 11001 is:
- A.21
- B.23
- C.25
- D.27
Show answer
Correct answer: C. 25
Explanation
The correct answer is C, 25. 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. The number 11001 has five bits, so the place values from left to right are 16, 8, 4, 2 and 1, and the bits are 1, 1, 0, 0 and 1. The sum is 16 + 8 + 0 + 0 + 1, which equals 25. Option A is wrong because 21 in binary is 10101. Option B is wrong because 23 in binary is 10111. Option D is wrong because 27 in binary is 11011. A useful check is that a binary number ending in 1 is always odd and one ending in 0 is always even, which immediately rules out any even option here.
Standard ASCII uses how many bits to represent one character?
- A.6
- B.7
- C.8
- D.16
Show answer
Correct answer: B. 7
Explanation
The correct answer is B, 7. 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 codes. In this code the capital letter A is 65, the small letter a is 97 and the digit character 0 is 48. Option A is wrong because six bits would allow only 64 characters, too few for both cases of the alphabet. Option C is wrong because eight bits describe Extended ASCII and EBCDIC, which reach 256 characters. Option D is wrong because sixteen bits describe the older fixed-width form of Unicode, the standard created so that Devanagari and every other script could be represented.
The 2's complement of the binary number 1010 is:
- A.0101
- B.0110
- C.1011
- D.1001
Show answer
Correct answer: B. 0110
Explanation
The correct answer is B, 0110. 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. Then add 1 to that result: 0101 plus 1 equals 0110. So the 2's complement of 1010 is 0110. Computers store negative numbers in 2's complement form because the same adder circuit can then perform both addition and subtraction, which saves hardware. Option A is wrong because 0101 is only the 1's complement, the first step, and forgetting to add one is the commonest mistake in this question. Option C is wrong because 1011 is simply 1010 with the last bit changed. Option D is wrong because 1001 is neither complement of the given number. Remember: 2's complement equals 1's complement plus one.
In the hexadecimal system, the symbol D stands for which decimal value?
- A.11
- B.12
- C.13
- D.14
Show answer
Correct answer: C. 13
Explanation
The correct answer is C, 13. 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. The mapping runs A for 10, B for 11, C for 12, D for 13, E for 14 and F for 15. The letter D is the fourth of these letters, so it stands for 13, whose binary form is 1101. Option A is wrong because 11 is B. Option B is wrong because 12 is C. Option D is wrong because 14 is E. A simple memory aid is that the letters continue the count from ten, so the position of the letter in the alphabet after A, plus ten, gives its value.
What is the largest unsigned decimal number that can be stored in one byte?
- A.127
- B.128
- C.255
- D.256
Show answer
Correct answer: C. 255
Explanation
The correct answer is C, 255. 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. Those 256 patterns represent the numbers from 0 to 255 when the byte is unsigned, because counting starts at zero. The largest pattern, 11111111, adds up to 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1, which equals 255. Option A is wrong because 127 is the largest positive value of a signed byte, where the leftmost bit is kept as the sign bit and only seven bits remain for the value. Option B is wrong because 128 is the place value of the leftmost bit alone. Option D is wrong because 256 is the count of patterns, not the largest value, a distinction examiners test often.
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





