TutorChase logo
Login
AQA A-Level Computer Science

5.4.2 Arithmetic with unsigned binary

Understanding how to perform binary arithmetic is essential for digital systems. This section explores binary addition and multiplication using only unsigned binary values.

What is unsigned binary arithmetic?

Unsigned binary is a way of representing only non-negative integers using binary digits (bits). Each binary digit can be either 0 or 1, and the value of the number is determined by the sum of powers of 2 based on the position of the bits. Because it does not support negative numbers, unsigned binary arithmetic is simpler than signed binary arithmetic, which requires a method for handling both positive and negative values.

When performing arithmetic with unsigned binary, we are dealing exclusively with numbers ranging from 0 up to the maximum that can be represented with a given number of bits. For example:

  • A 4-bit binary number can represent values from 0 to 15.

  • An 8-bit binary number can represent values from 0 to 255.

Take your grades to the next level!

UPGRADING TO PREMIUM UNLOCKS
AI Tutor
AI-powered study assistant
instant feedback and guidance
Predicted Papers
Examiner-style predicted papers
based on recent exam trends
Practice Questions
All exam practice questions
by topic for each subject
Study Notes
All detailed revision notes
written by expert teachers
Cheat Sheets
Quick revision summaries
perfect for last-minute review
Past Papers
Complete collection
of practice and past exam papers
Email
Password
Confirm Password
Already have an account?

Practice Questions

FAQ

When adding more than two binary numbers simultaneously, the process is generally broken down into a series of pairwise additions using binary adders. In digital systems, especially CPUs, this is handled by chaining multiple full adders together. A full adder can take three inputs: two binary digits and a carry-in from a previous operation. When dealing with multiple binary values, the system performs the addition in stages, adding two numbers at a time and using the resulting carry for the next addition. This method is known as cascaded addition. It’s important to manage carry bits correctly at each step, as they affect the accuracy of the final result. In high-performance computing systems, parallel adders may be used to add several numbers simultaneously by reducing the number of stages. However, with larger numbers, the possibility of overflow increases, so additional bits or overflow detection mechanisms are often included to ensure the result remains valid and within bounds.

When binary numbers of different bit lengths are added, the shorter number is first padded with leading zeros to match the length of the longer number. Padding does not change the value of the number but allows proper alignment of bits for addition. For example, if you are adding a 4-bit number (1010) to an 8-bit number (00011001), the 4-bit number is first padded to become 00001010. Then, normal binary addition rules apply, working from the least significant bit (rightmost) to the most significant (leftmost), carrying as needed. In computer systems, arithmetic units automatically manage bit length alignment to avoid incorrect results. However, if the result of the addition exceeds the bit width of the longest input, an overflow can occur. Programmers and digital designers must ensure that the bit length used for the result is large enough to accommodate the full range of possible outcomes, particularly when precision and accuracy are essential.

Binary multiplication is more efficient in computers than decimal multiplication because it reduces the operation to a series of simple logical steps—shifting and addition. In binary, each digit is either 0 or 1, so the process does not require multiplication tables or complex computations. Multiplying by 0 always results in 0, and multiplying by 1 leaves the value unchanged, making partial products straightforward to calculate. Furthermore, binary multiplication relies heavily on bitwise shifting, which is a very fast operation in hardware because it merely changes the wiring or register index and doesn’t involve actual calculation. In contrast, decimal multiplication requires managing digits 0 through 9 and involves more computational steps and carries, increasing processing time. Binary logic circuits like AND gates and adders can perform these operations directly on the processor’s binary data, making it ideal for digital systems. This efficiency is a key reason computers operate using binary instead of decimal internally.

To predict overflow during unsigned binary addition, compare the sum of the two highest-value bits (most significant bits) and check whether a carry out of the final bit position is likely. In n-bit unsigned binary, overflow happens when the result exceeds the maximum representable value, which is 2^n - 1. For example, in 8-bit binary, the highest value is 255. If you add two values whose decimal equivalents sum to more than 255, overflow is guaranteed. Without converting to decimal, you can inspect whether both numbers have a 1 in the most significant bit (MSB). If both do, it’s likely that adding them will cause a carry into a non-existent 9th bit, triggering overflow. For example, adding 10000000 (128) and 10000000 (128) results in 100000000 (256), a 9-bit result, so overflow occurs. Hardware typically uses a carry flag or overflow flag in the processor’s status register to detect and respond to such conditions.

The main limitation of binary multiplication using bitwise shifting is that it assumes fixed-length operands and results, which can lead to overflow if the result exceeds the allocated bit space. For example, multiplying two 8-bit numbers can produce a result requiring up to 16 bits, but if only 8 bits are available, higher bits may be lost, causing incorrect results. Another issue is that shift-and-add multiplication does not handle negative values or fractional values, as it assumes unsigned integers. Furthermore, this method can be inefficient for multiplying large numbers where many shifts and additions are required, especially if the multiplier has many 1s. To address these limitations, systems may use extended precision registers, where extra bits are allocated for results. Some processors use hardware multipliers that perform multiplication in a single cycle or specialised Booth’s algorithm to reduce the number of shifts. Software can also perform multi-precision arithmetic using arrays of smaller words to hold larger results.

Hire a tutor

Please fill out the form and we'll find a tutor for you.

1/2
Your details
Alternatively contact us via
WhatsApp, Phone Call, or Email