Overview
This unit introduces the number systems used in computers and in everyday life. Students will learn how numbers are written in different bases such as decimal (base 10), binary (base 2), octal (base 8) and hexadecimal (base 16). The unit explains place value in any base, conversion methods between bases, and simple arithmetic in binary. It also introduces binary complements used for subtraction and error-checking ideas. Understanding number systems is important because digital computers store and process information using binary digits (bits). Learning how to convert and operate in other bases helps students see how information is represented, how programming, memory addresses and digital electronics work at a basic level. The unit builds careful step-by-step methods so students can convert numbers, add and subtract in binary, and relate these ideas to everyday decimal arithmetic. By the end, students will be comfortable translating numbers between bases, performing simple binary calculations, and explaining why binary is used in computers. This knowledge prepares them for later topics in computing, such as data representation, logic circuits and programming, and strengthens general numeracy and problem solving.
Learning Objectives
- Describe the meaning of a number system and the role of base (radix) in place value notation.
- Convert whole numbers between decimal, binary, octal and hexadecimal systems using reliable methods.
- Explain why computers use binary and identify the digits (bits) of binary representation.
- Perform addition and subtraction of non-negative integers in binary and check results for correctness.
- Use positional place value rules to represent digits in bases up to 16 and read numbers correctly.
- Apply the 1's and 2's complement methods to represent negative numbers and to perform subtraction.
- Interpret and draw simple diagrams showing place value columns for different bases.
- Solve problems that require converting and computing with numbers in different bases.
Topics in this chapter
14 topics · tap a topic title to jump straight to it.
What is a Number System?
Introduction: A number system is a way to represent numbers using a set of symbols and a rule for their place values. The most familiar system is decimal, which uses ten symbols 0 to 9 and a base (radix) of 10. Each position in a number has a value that is a power of the base. For example, in decimal the rightmost digit is units (10^0), the next is tens (10^1), then hundreds (10^2), and so on.
Why systems matter: Different systems are useful for different purposes. Humans prefer decimal because we commonly count by tens. Computers prefer binary because electronic devices have two stable states, so only two symbols (0 and 1) are needed. Other useful systems include octal and hexadecimal which compactly represent groups of binary digits.
Place value idea: In any base b, a digit in position k from the right has value digit × b^k. Digits range from 0 to b−1. For base 2 (binary) digits are 0 and 1; for base 8 digits 0–7; for base 16 digits 0–9 and letters A–F representing values 10–15. Place value lets us build large numbers by combining powers of the base.
Reading and writing: To read a number, multiply each digit by its place value and add. To write a number in a given base, we choose digits so that the combined value equals the required number. This general method underlies conversion and arithmetic in any base.
- Example 1: In decimal 345 = 3×10^2 + 4×10^1 + 5×10^0.
- Example 2: In binary 1011 = 1×2^3 + 0×2^2 + 1×2^1 + 1×2^0 = 8+0+2+1 = 11 (decimal).
- Example 3: In hexadecimal 1A = 1×16^1 + 10×16^0 = 26 (decimal).
- Value = Σ (digit × base^position) where position counts from 0 at the rightmost digit
- Valid digits: 0,1,...,base−1
Decimal System (Base 10)
Overview: The decimal system is the one used in daily life and in most schools. It has ten digits from 0 to 9 and uses base 10. Each position in a number represents a power of 10 that increases from right to left. The familiar column names are units (10^0), tens (10^1), hundreds (10^2), thousands (10^3), and so on. This positional nature makes it easy to write very large numbers compactly and to perform arithmetic using column methods.
Place value in detail: A digit placed in the k-th position from the right represents digit × 10^k. For example the number 5,432 means 5×10^3 + 4×10^2 + 3×10^1 + 2×10^0. When you read or write numbers you are implicitly using this expansion. It also shows why the digit 9 is the highest single digit in decimal: adding one more makes the next higher place value increase by 1 and resets the lower place to 0 (a carry).
Addition and subtraction rules: Arithmetic in decimal uses carries and borrows based on groups of ten. For addition, add digits column by column starting from the right. If a column sum is 10 or more, write down (sum − 10) and carry 1 to the next column. For subtraction, if the top digit is smaller than the bottom digit in a column, borrow 1 (which equals 10 in that column) from the next left column. These rules are identical in spirit to rules used in other bases, only the threshold changes from 10 to the base value.
Multiplication and division reminders: Multiplication uses partial products and place shifts; division uses repeated subtraction of multiples and place value. Understanding decimal place value helps when converting to other bases because the same positional ideas apply but with different powers and digit ranges. Practise with clear column work and check results by reversing operations where possible.
- Example 1: 506 = 5×10^2 + 0×10^1 + 6×10^0 = 500 + 0 + 6.
- Example 2: Add 247 + 385: column addition gives 632.
- Example 3: Subtract 1000 − 457: borrow to get 543.
- Decimal place value: digit × 10^position
- Carry rule for addition: carry when column sum ≥ 10
Binary System (Base 2)
Introduction: Binary is the base-2 number system and it uses only two symbols: 0 and 1. It is fundamental to digital electronics and computing because hardware elements such as switches, transistors and memory cells naturally have two stable states. A bit is a binary digit and several bits together form larger groups such as nibbles (4 bits) and bytes (8 bits). Understanding binary helps you read how computers store numbers and process information at the hardware level.
Place value in binary: Each position in a binary number corresponds to a power of 2. From the right, the positions are 2^0 (units), 2^1 (twos), 2^2 (fours), 2^3 (eights), and so on. A binary number like 10110 means 1×2^4 + 0×2^3 + 1×2^2 + 1×2^1 + 0×2^0 = 16 + 0 + 4 + 2 + 0 = 22 in decimal. This place-value idea is identical to decimal but uses base 2 instead of 10.
Writing numbers in binary: To convert a decimal whole number to binary you can use repeated division by 2 and record remainders, or use subtraction of powers of two. For example, to write 13 in binary choose the largest power of 2 ≤ 13 (which is 8 = 2^3), subtract to get 5, then choose 4 (2^2), subtract to get 1, then choose 1 (2^0). Marking chosen powers gives 1 at those positions and 0 otherwise, producing 1101. Alternatively, divide 13 by 2 repeatedly and read remainders from last to first to get the binary digits.
Grouping and notation: Binary numbers can be long, so we often group bits into sets of four (nibbles) when converting to hexadecimal or into sets of eight for bytes. When writing or reading binary, make sure to align bits by their least significant bit (rightmost) and add leading zeros if necessary for grouping. Practise converting small numbers both ways until the patterns become familiar, and use binary addition and subtraction rules for arithmetic tasks.
- Example 1: Convert binary 10110 = 1×16 + 0×8 + 1×4 + 1×2 + 0×1 = 22 (decimal).
- Example 2: Convert decimal 9 to binary: 9 ÷ 2 gives remainders 1,0,0,1 → binary 1001.
- Example 3: Group bits: byte example 01101001.
- Binary place value: digit × 2^position
- Binary digits allowed: 0 or 1
Octal System (Base 8)
What is octal: The octal system uses eight digits, 0 through 7, and has base 8. Each digit represents a power of 8. From right to left the places are 8^0 (ones), 8^1 (eights), 8^2 (sixty-fours), etc. An octal number such as 725 equals 7×8^2 + 2×8^1 + 5×8^0 = 7×64 + 2×8 + 5 = 448 + 16 + 5 = 469 in decimal. This shows how place value works in octal just like in decimal or binary but with powers of 8.
Why octal was useful: Historically, octal was used in computing because three binary bits correspond exactly to one octal digit: 2^3 = 8. Grouping binary into threes makes conversion quick and compact. For early computers that used 12, 24 or 36-bit words, octal provided a neat way to present binary contents. Today, octal is less common than hexadecimal but still appears in areas such as file permission notation in some operating systems.
Conversion between octal and binary: Converting binary to octal is simple: group binary bits into sets of three starting from the right. If needed, add leading zeros to make full groups. Convert each 3-bit group to its octal digit (000→0, 001→1, …, 111→7). To convert octal to binary, replace each octal digit by its three-bit binary pattern. This method avoids passing through decimal and is exact for integers.
Arithmetic and practice: Addition and subtraction in octal follow the same column rules but carry when a column sum reaches 8 or more. Practice converting numbers between octal, binary and decimal, and try small arithmetic exercises in octal to learn the carry rules. Remember that digits in octal never exceed 7, and check answers by converting results back to decimal when learning.
- Example 1: Octal 157 = 1×8^2 + 5×8^1 + 7×8^0 = 3×64 + 5×8 + 7 = 111 decimal.
- Example 2: Binary 101110 → groups 101 110 → octal 5 6 so octal 56.
- Example 3: Convert decimal 64 to octal: 64 ÷ 8 = 8 rem 0; 8 ÷ 8 = 1 rem 0 → octal 100.
- Octal place value: digit × 8^position
- Binary-to-octal grouping: 3 bits → 1 octal digit
Hexadecimal System (Base 16)
Introduction: Hexadecimal is the base-16 number system and uses sixteen symbols: 0–9 for values zero to nine, and A–F for values ten to fifteen. Each hex place represents a power of 16: 16^0 (ones), 16^1 (sixteens), 16^2 (two hundred fifty-sixes), etc. Hexadecimal shortens long binary numbers because four binary bits correspond exactly to one hex digit (2^4 = 16), making hex a convenient and human-friendly representation of binary data.
Reading and converting hex: To read a hex number such as 2F3, convert digits to numeric values and multiply by powers of 16: 2×16^2 + 15×16^1 + 3×16^0 = 512 + 240 + 3 = 755 decimal. To convert a decimal number to hex use repeated division by 16 and record remainders; remember to replace remainders 10–15 with letters A–F. To convert binary to hex, group binary bits into sets of four starting from the right and translate each group to its hex digit.
Where hex is used: Hexadecimal appears frequently in computing: memory addresses, colour codes in web pages (e.g. #FF0000), machine code and debugging texts. It is especially helpful when dealing with bytes and words because each byte can be shown as two hex digits. For example, the byte 11111111 in binary is FF in hex and 255 in decimal, a compact representation.
Practice and tips: Memorise the hex values for A–F and the mapping between 4-bit binary patterns and hex digits. When converting, add leading zeros to the binary representation to complete groups of four. Frequent practice converting numbers and visualising bytes as hex will make reading and writing hex natural and quick for students moving into programming and hardware topics.
- Example 1: Hex 3A = 3×16 + 10 = 58 decimal.
- Example 2: Binary 10101111 → groups 1010 1111 → hex AF.
- Example 3: Hex FF = 15×16 + 15 = 255 decimal, often seen as the maximum of one byte.
- Hex place value: digit × 16^position
- Hex digit values: 0–9, A=10, B=11, C=12, D=13, E=14, F=15
- Binary-to-hex grouping: 4 bits → 1 hex digit
Converting Decimal to Other Bases
Method with repeated division: To convert a non-negative decimal whole number to another base b, use repeated division by b. Write the number as dividend and divide by b; note the quotient and the remainder. The remainder is the least significant digit (units) in base b. Replace the dividend with the quotient and repeat: divide the new dividend by b, record the remainder, and keep going until the quotient becomes zero. When finished, read the remainders from last to first to obtain the digits of the number in base b. This step-by-step procedure works for any integer base.
Detailed example and why it works: Suppose we convert decimal 45 to base 2. Divide 45 by 2 → quotient 22 remainder 1 (units bit). Divide 22 by 2 → quotient 11 remainder 0 (next bit). Continue: 11 ÷ 2 → 5 r1, 5 ÷ 2 → 2 r1, 2 ÷ 2 → 1 r0, 1 ÷ 2 → 0 r1. Reading remainders bottom-up gives 101101. Each remainder corresponds to the coefficient of successive powers of 2: r1×2^5 + r0×2^4 + ... + r1×2^0 equals the original number, which proves the method.
Converting to base 8 or 16: The same method applies for base 8 and base 16. For base 16, when a remainder is 10–15, represent it with letters A–F. Keep a clear table with columns: current dividend, quotient, remainder. After finishing, reverse the remainder column to form the converted number. This avoids mistakes from misordering digits.
Tips, edge cases and practice: Always record remainders and quotients carefully. For converting 0, remember the result is 0 in any base. For very large numbers, repeated division can be done with a calculator but follow the same steps. Practise converting to different bases and then convert back to decimal to check your work. For classroom work, writing steps in a neat two-column table prevents reversal errors and builds confidence in the algorithm.
- Example 1: Convert decimal 29 to binary: divisions give remainders 1,0,1,1,1 → binary 11101.
- Example 2: Convert decimal 100 to octal: 100 ÷ 8 = 12 r4; 12 ÷ 8 = 1 r4; 1 ÷ 8 = 0 r1 → octal 144.
- Example 3: Convert decimal 254 to hex: 254 ÷ 16 = 15 r14 → hex FE (14 → E).
- Repeated division algorithm: decimal → base b: keep dividing by b, collect remainders, read remainders in reverse.
- Remainder values are digits in target base.
Converting Other Bases to Decimal
Method using place values: To convert a number from base b to decimal, expand it using place values. Multiply each digit by b raised to the position index (positions start with 0 at the rightmost digit) and add the results. This method uses the definition of positional notation and is reliable for whole numbers in any base.
Step-by-step procedure: Write the number with digits labelled by positions: for a number d_n d_{n-1} ... d_1 d_0, calculate d_n×b^n + d_{n-1}×b^{n-1} + ... + d_1×b^1 + d_0×b^0. Perform each multiplication and then add the partial products to get the final decimal value. For bases above 10, convert letter digits (for example A–F in hex) into their numeric equivalents before multiplication.
Handling large powers and grouping: For long numbers compute powers of b step by step (b^0, b^1, b^2...) and use them to multiply digits. Alternatively, perform repeated multiplication by b: start with 0, for each digit from left to right set value = value×b + digit; after processing all digits value equals the decimal equivalent. The repeated multiplication method is less error-prone for long numbers and works similarly to how you evaluate numbers mentally in decimal.
Examples and checks: For instance, binary 11010 = 1×2^4 + 1×2^3 + 0×2^2 + 1×2^1 + 0×2^0 = 26. Hex 3B2 = 3×16^2 + 11×16^1 + 2×16^0 = 946. After conversion, check your result by converting back to the original base using repeated division; the two directions provide a useful verification method.
- Example 1: Octal 357 → 3×8^2 + 5×8^1 + 7×8^0 = 3×64 + 5×8 + 7 = 191 decimal.
- Example 2: Hex AC = 10×16 + 12 = 172 decimal.
- Example 3: Binary 100101 → 1×32 + 0×16 + 0×8 + 1×4 + 0×2 + 1×1 = 37 decimal.
- Decimal conversion: decimal value = Σ digit × base^position
- Letter digits: A=10 ... F=15 for hex
Binary Addition
Basic rules: Binary addition works like decimal addition but with base 2. The possible sums of two bits (plus a carry) are limited: 0+0=0, 0+1=1, 1+0=1, 1+1=10 (which means write 0 and carry 1). If there is also a carry-in from the previous column, then 1+1+1=11 (write 1 and carry 1). Always add from right to left and keep track of the carry for the next column.
Step-by-step method: 1) Align the binary numbers by their least significant bits (rightmost). 2) Starting at the rightmost column, add the two bits and any carry-in. 3) Write down the result bit (0 or 1) and compute the carry-out (0 or 1). 4) Move one column left and repeat until all bits and the last carry are processed. If a final carry remains, include it as a new leftmost bit to get the complete result.
Carry propagation: A single carry can propagate across several columns if consecutive column sums equal the base. For example adding 1 to 1111 will flip all bits to 0000 and produce a carry that creates a new leftmost 1, giving 10000. This carry behaviour is important in understanding overflow in fixed-size binary words used by computers.
Verification and tips: After performing binary addition, convert the operands and the result to decimal to check the work. Use columns and write carries clearly above the digits to avoid mistakes. Practice adding numbers of different lengths and with multiple carries to build fluency. Recognise special cases like adding zero or adding a number to its two's complement to perform subtraction as addition.
- Example 1: 1011 + 1101: add columns gives 11000 (binary) = 24 decimal (11+13=24).
- Example 2: 111 + 1 = 1000 (binary) since 7+1=8 decimal.
- Example 3: 1001 + 0110 = 1111 (binary) = 15 decimal.
- Basic binary sums: 0+0=0, 0+1=1, 1+1=10 (0 with carry 1), 1+1+1=11 (1 with carry 1)
Binary Subtraction and Borrowing
Subtraction basics: Binary subtraction uses the same column method as decimal subtraction but borrows are in base 2. The fundamental single-column results are: 0−0=0, 1−0=1, 1−1=0, and 0−1 requires a borrow. When you borrow 1 from the next higher place in binary, that borrow equals 2 in the current place because base = 2. So 0−1 becomes (2−1)=1 after borrowing.
Borrowing process explained: To borrow, move left to find the first 1 bit. Change that 1 to 0 and change any bits between it and the target column that were 0 into 1 (because each borrowed 1 reduces the next higher 1 and supplies a chain of 2s). Then perform the subtraction in the target column. This can be visualised as exchanging a higher-power 1 for two lower-power units, then continuing as needed until the column has a value to subtract from.
Worked steps and verification: Align the minuend and subtrahend at the right. Subtract column by column from right to left, borrowing when necessary. After completing subtraction, verify the result by converting operands and result to decimal and checking that minuend − subtrahend equals the result. Using two's complement is an alternative used in computers to perform subtraction by addition, avoiding manual borrowing in algorithmic implementation.
Common borrow patterns: When subtracting numbers like 1000 − 1, a borrow cascades through multiple zeros and results in 0111. Practice such patterns to become confident. Always be careful to mark borrowed bits and keep track of changes to intermediate bits so no step is lost.
- Example 1: 1010 − 0011: subtract gives 0111 (binary) = 7 decimal (10 − 3 = 7).
- Example 2: 1000 − 1 = 0111 (binary) since 8 − 1 = 7.
- Example 3: 11000 − 1010 = 10010 (binary).
1's and 2's Complement
Purpose: Complements are used to represent negative integers and to perform subtraction as addition. The 1's complement of a binary number is formed by flipping each bit: change every 0 to 1 and every 1 to 0. The 2's complement is obtained by taking the 1's complement and adding 1. Computers commonly use 2's complement because arithmetic with it allows subtraction to be done by addition and because there is only one representation for zero.
Forming 2's complement step-by-step: Choose a fixed word size (for example 8 bits). To get the negative of a positive number: write the positive value in the chosen number of bits, flip all bits (1's complement) and then add 1 to the result. The bit pattern then encodes the negative value under 2's complement rules. For example, with 8 bits +5 is 00000101. Flipping gives 11111010. Adding 1 yields 11111011 which is −5 in 8-bit two's complement notation.
Range and overflow: For n bits, two's complement represents integers from −2^(n−1) to 2^(n−1) − 1. For instance, 8-bit signed integers range from −128 to +127. Overflow occurs when a computation produces a result outside this range—hardware detects overflow differently depending on signed or unsigned interpretation. Also note that two's complement arithmetic automatically handles sign during addition; when adding a positive and a negative number the same binary addition rules apply and an extra carry beyond the word length is discarded.
Practical examples and checks: To verify complements, add a number and its 2's complement negation; the result should be zero within the fixed bit width (ignoring final carry). Practice forming complements for several numbers and work examples where addition of signed numbers crosses the sign boundary so that students understand overflow and how computers represent and check it.
- Example 1: 8-bit +12 = 00001100; 1's complement = 11110011; 2's complement = 11110100 = −12.
- Example 2: Add 00000111 (+7) and 11111001 (−7) → 00000000 ignoring final carry.
- Example 3: With 4 bits, −3 is: +3=0011 → 1's comp 1100 → add1 → 1101.
- 1's complement: flip each bit (0↔1)
- 2's complement: 2's_comp(N) = 1's_comp(N) + 1
Conversions Between Binary, Octal and Hex
Grouping method: Because 8 = 2^3 and 16 = 2^4, conversions between binary, octal and hexadecimal are simple using bit grouping. To convert binary to octal split the binary number into groups of three bits starting from the right. Add leading zeros if needed to complete the leftmost group. Each 3-bit group translates directly to one octal digit. To convert binary to hexadecimal, split into groups of four bits and translate each quartet to its hex digit (0–9, A–F).
Reverse conversions: Converting octal or hex to binary simply reverses the mapping: replace each octal digit with its 3-bit binary equivalent and each hex digit with its 4-bit binary equivalent. This mapping is exact and lossless for integers, which makes it ideal for reading binary data in compact human-friendly forms without doing repeated division or place-value expansion.
Step-by-step examples and checks: For instance, take binary 110101. Grouping from the right gives 110 101 so octal digits 6 and 5 produce octal 65. For hexadecimal, binary 110101 groups as 0011 0101 after adding a leading zero to make four-bit groups, giving hex 35. Always add leading zeros when necessary to complete the leftmost group so that group sizes are consistent. After conversion, verify by converting the octal or hex result back to binary or decimal to ensure correctness.
Useful memorisation and practice: Memorise the mapping of 3-bit groups 000..111 to octal 0..7 and 4-bit groups 0000..1111 to hex 0..F. Practice converting longer binary sequences by grouping and translating each group. This skill is helpful in computing tasks like reading machine output, debugging, interpreting memory dumps, and understanding compact notations for bytes and larger words.
- Example 1: Binary 10110111 → group 101 101 111 → octal 5 5 7 → octal 557.
- Example 2: Binary 110111001011 → group 1101 1100 1011 → hex D C B → hex DCB.
- Example 3: Hex 3F → binary 0011 1111 → octal grouping 011 111 → octal 37.
- Binary-to-octal: group 3 bits → 1 octal digit
- Binary-to-hex: group 4 bits → 1 hex digit
Representing Fractions in Different Bases (Intro)
Extending place value to fractions: Positional notation applies to fractional parts using negative powers of the base. In base b, the first digit to the right of the point represents b^−1, the next b^−2, and so forth. For example in decimal 0.25 = 2×10^−1 + 5×10^−2. In binary, 0.1 denotes 1×2^−1 = 0.5 in decimal. Understanding these negative powers clarifies how fractional values are represented in any base.
Converting fractional decimal to another base: Use repeated multiplication by the target base. Multiply the fractional part by b. The integer part of the product is the next digit in the target base. Remove the integer part and repeat with the new fractional remainder. Continue until the fractional remainder becomes zero or until you have obtained the required number of digits for the desired precision. For example, to convert 0.625 to binary: 0.625×2=1.25 → digit 1; 0.25×2=0.5 → digit 0; 0.5×2=1.0 → digit 1. So 0.625 decimal = 0.101 binary.
Non-terminating and repeating fractions: Some decimal fractions do not have finite representations in another base, just as 1/3 has a repeating decimal form. For example 0.1 decimal becomes a repeating binary fraction. When a fraction repeats, you will see a repeating pattern of digits in the target base. In practical computing, fractional binary numbers are stored approximately using fixed precision (limited number of bits), so rounding and truncation must be considered.
Practical advice and checks: When converting fractions, decide on the number of digits needed and stop after reaching that precision, noting if the result is rounded. To check, convert the result back to decimal using negative powers of the base and compare with the original. Practice with both terminating and repeating examples to become familiar with differences in representation across bases.
- Example 1: Decimal 0.75 to binary: 0.75×2=1.5 →1, then 0.5×2=1.0 →1 → binary 0.11.
- Example 2: Binary 0.101 = 1×2^−1 + 0×2^−2 + 1×2^−3 = 0.5 + 0 + 0.125 = 0.625 decimal.
- Example 3: Decimal 0.2 to binary → repeating pattern, so write approximate bits to required precision.
- Fraction place values: digit × base^(−k) for k=1,2,...
- Repeated multiplication method: multiply fraction by base, integer parts give digits
Applications of Number Systems in Computing
Representing data: Number systems are the foundation for how computers store and process information. All data inside a computer—numbers, letters, images, sounds—are ultimately stored as sequences of bits (binary digits). Different bases are used to present those bit sequences in human-friendly ways: hexadecimal and octal compactly show binary data, while decimal remains the standard for everyday numbers.
Memory, bytes and sizes: Memory and storage are measured in bits and bytes. A byte equals 8 bits and commonly stores a single character or a small integer. Memory addresses and machine code are often written in hexadecimal to shorten long binary strings; two hex digits represent one byte. Understanding how many values fit in a given number of bits (for example 8 bits can show 0–255 unsigned) helps when studying limits, overflow and data types in programming.
Practical uses: Hexadecimal is used in programming and debugging (e.g. 0x1A3F), and in colour codes for web pages (#FF0000). Octal appears in places such as file permission notation in operating systems. Binary understanding is essential for logic circuits, where on/off states correspond to 1 and 0, and for learning how arithmetic and logical operations are implemented in processors.
Learning outcome and real tasks: Students should be able to read and write byte values in hex, convert between binary and hex for small sequences, and explain why binary is used in hardware. These skills prepare learners for programming, understanding data representation, and later topics like networking, where addresses and masks are expressed using binary and hex notation. Practice with real examples (colour codes, addresses, permissions) makes theory concrete and relevant.
- Example 1: RGB colour #00FF00 is hex for (0,255,0) meaning bright green.
- Example 2: Memory address shown as 0x1A3F in hex is easier to write than a long binary string.
- Example 3: File permission 755 (octal) in Linux represents read/write/execute bits.
Checking Work and Common Errors
Why verification helps: Converting numbers between bases and doing arithmetic in binary can involve many small steps where mistakes often appear: misplaced carry, wrong remainder order, missing leading zeros, or incorrect mapping of hex letters. Developing quick verification steps reduces errors and builds confidence. Use reverse conversions, decimal checks, and clear notation to find mistakes quickly.
Methods to check conversions: After converting a decimal to another base by repeated division, convert the result back to decimal by using place values and ensure you get the original number. When converting binary to hex or octal by grouping, convert the grouped result back to binary to confirm the mapping. For fractional conversions, perform the reverse repeated multiplication/division to check consistency within the chosen precision.
Checking arithmetic: For binary addition or subtraction, convert operands and result to decimal and verify that the arithmetic holds. When using two's complement for subtraction, add the minuend and the two's complement of the subtrahend and confirm the expected result (ignoring any final carry beyond the fixed word size). Also check whether any overflow or sign-change is expected given the bit width used.
Common errors and how to avoid them: Common problems include forgetting to reverse remainders when using repeated division, losing the carry or borrow in arithmetic, misreading A–F in hexadecimal, and forgetting to add leading zeros for grouping. To avoid these, write each step clearly, use labeled columns for quotients and remainders, mark carries and borrows above digits, and always perform a final check by converting back to a known base (usually decimal). Practise these habits until they become routine.
- Example 1: Convert 45 to binary and back to decimal to confirm the result.
- Example 2: After binary addition, convert operands and result to decimal to verify sum.
- Example 3: When grouping binary for hex, add leading zeros to complete groups of four.
Key Concepts
- Base (Radix)
- The number of unique digits in a number system and the value used for place-value powers.
- Place Value
- The value of a digit determined by its position multiplied by a power of the base.
- Binary
- The base-2 number system using digits 0 and 1.
- Octal
- The base-8 number system using digits 0–7.
- Hexadecimal
- The base-16 number system using digits 0–9 and A–F.
- Bit
- A binary digit, either 0 or 1, the smallest unit of data in computing.
- Byte
- A group of eight bits used as a standard unit of digital information.
- Repeated Division Method
- A method to convert decimal to another base by dividing by the base and collecting remainders.
- Repeated Multiplication Method
- A method to convert fractional decimal parts to another base by multiplying and taking integer parts.
- 1's Complement
- A binary complement formed by flipping every bit (0 to 1 and 1 to 0).
- 2's Complement
- Formed by taking 1's complement and adding 1; used to represent signed integers in binary.
- Carry and Borrow
- Operations in addition and subtraction when a column sum exceeds the base or a digit is too small to subtract.
- Grouping (for conversion)
- Splitting binary bits into groups of 3 for octal or 4 for hex to convert quickly.
- Fractional Place Value
- Positions right of the point representing negative powers of the base, e.g., base^(−1), base^(−2).
Practice Questions
-
Convert the decimal number 37 to binary. / दशमलव संख्या 37 को बाइनरी में बदलिए।
Show answer
Answer: Decimal 37 → binary 100101. Explanation: 37 ÷ 2 remainders give 1,0,1,0,0,1 reading upwards = 100101. / उत्तर: दशमलव 37 → बाइनरी 100101। व्याख्या: 37 ÷ 2 के शेष क्रम से ऊपर से पढ़ने पर 100101 मिलता है।
-
Convert binary 110011 to decimal. / बाइनरी 110011 को दशमलव में बदलिए।
Show answer
Answer: 110011 (binary) = 1×32 + 1×16 + 0×8 + 0×4 + 1×2 + 1×1 = 51 decimal. / उत्तर: 110011 (बाइनरी) = 32 + 16 + 0 + 0 + 2 + 1 = 51।
-
Add the binary numbers 1011 and 1101. / बाइनरी संख्याएँ 1011 और 1101 जोड़िए।
Show answer
Answer: 1011 + 1101 = 11000 (binary). Check: 11 + 13 = 24 decimal and 11000 (binary) = 24. / उत्तर: 1011 + 1101 = 11000 (बाइनरी)। जाँच: 11 + 13 = 24 और 11000 (बाइनरी) = 24।
-
Convert hexadecimal 2A to decimal. / हेक्साडेसिमल 2A को दशमलव में बदलिए।
Show answer
Answer: 2A = 2×16 + 10 = 42 decimal. / उत्तर: 2A = 2×16 + 10 = 42।
-
Convert binary 11110001 to hexadecimal. / बाइनरी 11110001 को हेक्साडेसिमल में बदलिए।
Show answer
Answer: Group as 1111 0001 → hex F1. / उत्तर: समूह 1111 0001 → हेक्स F1।
-
Using 8 bits, find the 2's complement representation of −6. / 8 बिट्स का उपयोग करके −6 का 2's कम्प्लीमेंट प्रतिनिधित्व निकालिए।
Show answer
Answer: +6 = 00000110; 1's complement = 11111001; add 1 → 11111010 which is −6 in 2's complement (8 bits). / उत्तर: +6 = 00000110; 1's कंप्लीमेंट = 11111001; 1 जोड़ने पर 11111010 जो 8 बिट में −6 दर्शाता है।
-
Convert decimal 100 to octal. / दशमलव 100 को ऑक्टल में बदलिए।
Show answer
Answer: 100 ÷ 8 = 12 r4; 12 ÷ 8 = 1 r4; 1 ÷ 8 = 0 r1 → octal 144. / उत्तर: 100 ÷ 8 = 12 शेष 4; 12 ÷ 8 = 1 शेष 4; 1 ÷ 8 = 0 शेष 1 → ऑक्टल 144।
-
Explain why computers use binary instead of decimal. / बताइए कि कम्प्यूटर दशमलव के बजाय बाइनरी का उपयोग क्यों करते हैं।
Show answer
Answer: Computers use binary because electronic components have two stable states (on/off) that map naturally to 1 and 0, making storage and switching reliable and simple. It reduces complexity in circuits and provides clear representation for logic operations. / उत्तर: कम्प्यूटर बाइनरी का उपयोग इसलिए करते हैं क्योंकि इलेक्ट्रॉनिक घटकों की दो स्थिर अवस्थाएँ (चालू/बंद) 1 और 0 से सरलता से जुड़ जाती हैं; इससे सर्किट सरल और भरोसेमंद बनते हैं और तार्किक कार्य आसान हो जाते हैं।
-
Convert decimal fraction 0.625 to binary. / दशमलव भिन्न 0.625 को बाइनरी में बदलिए।
Show answer
Answer: 0.625×2=1.25 → digit 1; 0.25×2=0.5 → digit 0; 0.5×2=1.0 → digit 1. So 0.625 = 0.101 (binary). / उत्तर: 0.625×2=1.25 → अंक 1; 0.25×2=0.5 → अंक 0; 0.5×2=1.0 → अंक 1. अतः 0.625 = 0.101 (बाइनरी)।
-
Convert hex F to decimal and explain its significance for one byte. / हेक्स F को दशमलव में बदलिए एवं एक बाइट के लिए इसका महत्त्व बताइए।
Show answer
Answer: Hex F = 15 decimal. In one nibble (4 bits) F is the maximum value; in a full byte two hex digits FF = 255 decimal which is the maximum value an unsigned byte can store. / उत्तर: हेक्स F = 15 (दशमलव)। एक निबल (4 बिट) में F सबसे बड़ा मान है; एक बाइट के दो हेक्स अंक FF = 255 (दशमलव) होते हैं जो एक बिना-साइन वाले बाइट की अधिकतम मान को दर्शाता है।
Related Laws & Principles
Explore allFoundational laws & principles connected to this chapter — tap to open in the Laws Explorer.