Skip to content

Binary Numbers and Radix

標準~26 min4 terms11 past questions

Goals of this unit

  • Read the value of the integer and fractional parts of a binary number (2進数) from the weight of each digit.
  • Carry out radix conversion (基数変換) between binary and decimal, octal, or hexadecimal.
  • Handle the carries in binary addition (加算) and the borrows in binary subtraction (減算).
Terms at a glance (4)
TermIn one lineClue
2進数A way of writing numbers with only 0 and 1, where each digit's weight doubles as you move leftWeights from the right: 1, 2, 4, 8
基数変換Rewriting the same value in another notation that uses a different set of digitsMultiply by weights and add / read the remainders of dividing by 2 in reverse
加算Adding from the lowest digit up and carrying 1 to the next digit whenever a sum reaches 2 or more1+1=10
減算Subtracting from the lowest digit up and borrowing 1 from the next digit wherever you can't subtractA borrowed 1 counts as 2 in that digit

Terms

2進数Binary number

Open in glossary 2進数

A binary number (2進数) represents values using only two digits, 0 and 1, and each time you move one digit to the left, the size that a 1 in that digit stands for (its weight) becomes twice as large.

Digit positionWeightAs a power of 2
Integer part, 4th digit from right82 to the 3rd power
Integer part, 3rd digit from right42 to the 2nd power
Integer part, 2nd digit from right22 to the 1st power
Integer part, rightmost digit12 to the 0th power
1st place after the point0.52 to the -1st power
2nd place after the point0.252 to the -2nd power

The number of different digits that one position can use is called the radix (基数), and the radix of binary is 2. Weights in the integer part double from the right as 1, 2, 4, 8, while weights to the right of the point halve as 0.5, 0.25, 0.125. Negative numbers are usually written in two's complement (2の補数), formed by flipping every 0 and 1 of the positive number and then adding 1.

AnalogyIt is like a row of lamps that can only be on or off, where the pattern of which lamps are lit stands for a number.

How to rememberThink of "base 2" as "once two pile up, move on to the next place." In base 10 (decimal), you move on only when ten pile up.

Exam points

  • ExamThe value of the fractional part of a binary number (2進数) is the sum of the weights (one over a power of 2) of the digits that hold a 1. A decimal (10進数) fraction that cannot be written as such a sum does not fit into a finite number of binary digits.
  • ExamAn n-digit binary number (2進数) can distinguish 2 to the n-th power values. When several binary numbers are combined to express one state, the number of possible states is the product of each one's count.
  • ExamAn n-digit binary number (2進数) in two's complement (2の補数) covers the integers from −2^(n−1) up to 2^(n−1) − 1, with one more value on the negative side than on the positive side.

3 past questions on this term 2進数

基数変換Radix conversion

Open in glossary 基数変換

Radix conversion (基数変換) means rewriting a value in a notation with a different radix while leaving the value itself unchanged.

  1. 13 ÷ 2 = 6 remainder 1
  2. 6 ÷ 2 = 3 remainder 0
  3. 3 ÷ 2 = 1 remainder 1
  4. 1 ÷ 2 = 0 remainder 1
  5. Remainders read from last: 1101

Reading the remainders from the last one gives 1101, the binary form of 13.

4 / 4

To turn a binary number into decimal, multiply each digit by its weight and add the results. To turn a decimal number into binary, keep dividing by 2 until the quotient reaches 0, then line up the remainders starting from the last one. Hexadecimal uses 16 digits, 0 to 9 and A to F; one hexadecimal digit matches four binary digits, and one octal digit matches three.

AnalogyLike restating the same length in inches instead of centimeters: the amount stays put, and only the ruler used to write the number changes.

How to remember16 is 2 to the 4th power, so one hex digit covers four binary digits; 8 is 2 to the 3rd power, so one octal digit covers three.

Exam points

  • ExamBesides dividing by 2, you can convert a decimal (10進数) number to binary (2進数) by subtracting the weights from the largest down, writing 1 in each digit whose weight could be subtracted and 0 where it could not.
  • ExamTo convert between octal (8進数) and hexadecimal (16進数), first rewrite the number in binary (2進数) and regroup it into blocks of three or four digits, starting from the right end. Hexadecimal A to F equal decimal 10 to 15.
  • ExamEven a notation written with symbols or shapes has the same structure as binary (2進数) if the weight of each position doubles from the right as 1, 2, 4, 8, and adding the weights of the positions holding the symbol for 1 gives the value.

3 past questions on this term 基数変換

Binary addition (加算) adds digit by digit from the lowest one up, and whenever a digit's sum reaches 2 or more, it carries 1 into the next higher digit.

Digit weightNumber added toNumber being addedCarry from belowResult in this digitCarry to above
111001
201101
411111
800110
Whole (decimal)0101 (5)0111 (7)None1100 (12)None

Adding one digit to another gives 0+0=0, 0+1=1, 1+0=1, and 1+1=10, so a carry appears only for 1+1. When a digit that already received a carry from below becomes 1+1+1, it keeps 1 and also carries 1 upward. Doubling a number shifts the whole thing one digit to the left, and multiplication can be done as an addition of shifted copies.

AnalogyPicture a wallet with a rule: as soon as two coins of the same kind pile up, they are swapped for one coin of the next higher value.

How to rememberBinary 1+1 plays the same role as decimal 9+1: in both, the digit rolls over the moment it passes the largest digit that place can hold.

Exam points

  • ExamIn addition (加算) with many digits, a carry can ripple on from one digit to the next. You can also check the result by converting both numbers to decimal, adding them, and converting back to binary (2進数).
  • ExamMultiplying a binary number (2進数) by 2 shifts it one digit to the left and puts 0 at the right end. For multiplication, line up a shifted copy of the multiplicand for each 1 in the multiplier and add them together.

3 past questions on this term 加算

Binary subtraction (減算) subtracts digit by digit from the lowest one up, and in any digit where it can't subtract, it first borrows 1 from the next higher digit and then subtracts.

Digit weightMinuendSubtrahendHandling the borrowDifference in this digit
101Borrow from above to make 2, then 2 - 11
200Borrow from above to make 2, lend 1 below, 1 remains1
400Borrow from above to make 2, lend 1 below, 1 remains1
810Lend 1 below and become 00
Whole (decimal)1000 (8)0001 (1)The borrow runs through 3 digits0111 (7)

A 1 in a higher digit equals 2 in the digit just below, so the digit that borrowed subtracts from its value plus 2. When borrowing across a run of 0s, the borrow travels up to the first digit holding a 1, and each 0 in between becomes 1. Inside a computer, subtraction is often done with the addition circuit by turning the subtrahend into two's complement (2の補数) and adding it.

AnalogyJust as you break a large coin into change when you are short, in binary one coin from the higher place breaks into exactly two.

Exam points

  • Mix-upIn binary (2進数) subtraction (減算), the 1 borrowed from a higher digit counts as 2 in the digit that borrowed it. That differs from decimal long subtraction, where a borrowed 1 counts as 10.

Addition vs. Subtraction

AspectAdditionSubtraction
Operation in each digitAdd that digit's numbers and the carrySubtract the subtrahend from that digit's number
Key differenceExchange with the higher digitWhen the sum reaches 2 or more, carry 1 to the higher digitWhen it can't subtract, borrow 1 from the higher digit and use it as 2
When the exchange chains onCarries chain through a run of 1sBorrows chain through a run of 0s
Number of digits in the resultMay gain one digit over the original numbersHigher digits may become 0, leaving fewer digits

Key points

  • A binary number (2進数) uses only 0 and 1, and digit weights double in the integer part and halve in the fractional part.
  • An n-digit binary number can distinguish 2 to the n-th power values.
  • Binary to decimal: multiply by the weights and add; decimal to binary: line up the remainders of dividing by 2, starting from the last.

Check questions

5 past questions from this unit

Start the check questions

All past questions in this topic