All data inside aircraft computers (FMGC, FWC, SDACβ¦) is processed in binary, but humans need intermediate number systems (octal, hexadecimal, BCD) to read and enter data conveniently. This module rebuilds the four core number systems and their real applications on the Airbus A320.
Tooley ch.2 (p.25-38) Β· Floyd ch.2 (p.65-124)
PART 1/5
01
Why does an aircraft computer need several number systems?
Review of the decimal system: the one humans use every day
Binary: the foundation of every digital circuit
Octal and hexadecimal: compact shorthand for binary
BCD: the bridge between decimal digits and 7-segment displays
PART 1/5 Β· 01
Why not just use decimal directly in electronic circuits?
Digital electronic circuits can only reliably distinguish two voltage levels (high/low), not ten distinct levels needed for decimal digits. Hardware is therefore forced into binary (2 levels); every other number system (octal, hex, BCD) is simply a human-friendly shorthand for that same binary string.
π Explained for complete beginners
Picture a light switch: it has two states, on or off, and you can tell them apart instantly even if the voltage wobbles a little. Now picture a switch with ten notches for the digits 0 to 9. A bit of electrical noise or an aging component could make the circuit read notch 4 as notch 5.
That is why digital circuits are built to separate only two voltage levels (typically 0 V and 5 V). The wide gap between them tolerates noise well. Octal, hex and BCD, covered later, are not different ways of computing inside the hardware. They are shorthand that lets people write the same binary string more compactly.
PART 1/5 Β· 01
Four core number systems in avionics
System
Base
Digits used
Main role
Binary
2
0,1
Internal computer processing
Octal
8
0-7
Compact system status codes
Hexadecimal
16
0-9,A-F
Memory addresses, BITE fault codes
BCD
n/a
4 bits/digit
Decimal display on screens
Click the image to enlargeπ Explained for complete beginners
The image above comes from the original lecture slide. It summarises the four number systems in this module and the real job each one does on the A320. Binary is the internal language of every onboard computer (FMGC, FWC, SDAC). Octal shortens status codes on some older MCDU pages. Hex covers memory addresses and BITE fault codes because it is compact and easy to look up. BCD bridges the internal binary value to the familiar decimal digits on cockpit displays.
On a first pass, do not try to memorise every detail in the picture. Keep the main idea: four systems, four roles, all describing the same data underneath.
PART 1/5 Β· 01
Positional weighting: the principle shared by every base
In any base-b system, the digit at position i (from the right, starting at 0) carries weight bβ±. The value of the whole number equals the sum of (digit Γ weight).
Value of a number in base b
N = Ξ£ dα΅’Β·bβ±
π Explained for complete beginners
This is the most general formula in the module and it works for any base, so read it slowly. "Positional weighting" means a digit's real value depends on where it sits. In 528, the digit 5 is worth 500, not 5, because it stands in the hundreds place.
The formula N = Ξ£ dα΅’Β·bβ± restates that in symbols. dα΅’ is the digit at position i (counted from the right, starting at 0), b is the base, bβ± is the weight of that position, and Ξ£ means "add everything up". The next slide applies it to a familiar decimal number before we move to binary.
PART 1/5 Β· 01
Example: applying positional weight to a familiar decimal number
528 (base 10) = 5Β·10Β² + 2Β·10ΒΉ + 8Β·10β° = 500+20+8 = 528. This is exactly the same principle the course will re-apply to base 2, 8 and 16: only the value of b changes.
Click the image to enlargeπ Explained for complete beginners
The example 528 = 5Γ10Β² + 2Γ10ΒΉ + 8Γ10β° is just a formal spelling of the sum 500+20+8 that everyone learned in primary school. The only new thing is seeing that it matches the positional-weight formula.
The attached image shows that decimal is still what pilots and engineers see every day on EFIS, FMS and weight tables. The reason is simply that people count on ten fingers. Inside the computer, each of these numbers has already been converted to binary before any calculation, then converted back only so a human can read it.
PART 1/5 Β· 01
Why technicians don't read raw long binary strings
A 16-bit memory address written in binary is 16 characters long (e.g. 1010110011110000), easy to mistype or misread a single bit. Rewritten in hex it is only 4 characters (ACF0): this reduces transcription error, a practical engineering reason, not just a theoretical one.
π Explained for complete beginners
Compare the two forms. The binary string 1010110011110000 is 16 characters long. Misreading or mistyping just one bit in the middle ruins the whole address, and the eye struggles to spot the slip in a long run of look-alike 0s and 1s.
Written in hex, the same value is only 4 characters (ACF0). Fewer characters mean fewer chances to slip, and the eye tells 0-9 and A-F apart far more easily than a wall of 0s and 1s. This is a practical reason, not only a mathematical one, and it is why maintenance documents record addresses and fault codes in hex.
PART 1/5 Β· 01
The four systems are not independent: constant conversion is required
The computer PROCESSES in binary
The display SHOWS the pilot BCD/decimal
Maintenance logs RECORD fault codes in hex
Some legacy status pages use octal
Maintenance engineers must be fluent converting in all four directions, not just one.
Click the image to enlargeπ Explained for complete beginners
The triangle diagram shows that no number system stands alone. All four have two-way "Conversion" arrows linking them to the others, so engineers convert back and forth constantly.
In the figure, each system has its own sample number: (9856)ββ, (101010101)β, (7537)β and (A89DE)ββ. These are four different numbers, shown only to illustrate that each system has its own digits, with the small subscript naming the base. The bullets beside the diagram state the real roles: computers process in binary, displays show BCD or decimal, maintenance documents record fault codes in hex, and a few legacy status pages use octal.
PART 1/5 Β· 01
β οΈ Trap: confusing a 'number system' with a 'unit of measure'
Beginners often confuse 10ββ (sixteen, base 16) with 10 (ten, base 10) because the digits look identical. Always mark the base subscript explicitly, as Tooley's convention shows: (75)β, (75)ββ, (75)ββ are THREE completely different values despite sharing the digits '7','5'.
π Explained for complete beginners
This is an easy trap: you see "10" and read "ten" out of habit. But 10ββ (read "one zero, base sixteen") is really sixteen, while 10β is two and 10β is eight.
The three numbers (75)β, (75)ββ and (75)ββ look identical character by character, yet they stand for three different values: 61, 75 and 117 in decimal. The rule that saves you: always write the base subscript (β, β, ββ, ββ) whenever a number is not in default decimal.
PART 1/5 Β· 01
Application on the A320: why the FMGC must understand all four systems
The FMGC (Flight Management Guidance Computer) receives binary sensor data, computes internally in binary, but must OUTPUT hex for maintenance logs, BCD for the MCDU display, and sometimes octal for status codes: one processing chip constantly converts between these systems in real time.
π Explained for complete beginners
The FMGC (Flight Management Guidance Computer) shows these four systems are not idle theory. It receives sensor data already digitised into binary and performs every internal calculation in binary, because that is the only language its processor understands.
When it must send results outward, it translates to suit the purpose: hex for maintenance logs, BCD for the pilot's MCDU display, and occasionally octal for some legacy status codes. One chip does this translation thousands of times per second, in real time.
PART 1/5 Β· 01
Data flow diagram of a numeric value in the cockpit
Sensor (analog) β ADC β binary (processed inside FMGC/FWC) β re-encoded as BCD/hex β shown on EFIS/ECAM or logged by BITE. Every arrow in this chain is a point where the active number system must be correctly identified.
π Explained for complete beginners
The diagram traces the life of one measured quantity, say air pressure. The sensor produces an analog signal (a smoothly varying voltage). The ADC (Analog-to-Digital Converter) turns it into a discrete binary string. The FMGC or FWC calculates entirely in binary. The result is then re-encoded as BCD or hex, depending on whether it goes to a display (EFIS/ECAM) or to a log (BITE).
Each arrow is a real conversion inside real hardware. If any step uses the wrong number system, the value the pilot sees ends up wrong too.
PART 1/5 Β· 01
Quick self-check (ungraded)
Pause for 30 seconds: can you explain out loud why a maintenance engineer CANNOT learn just one number system and skip the other three? If unsure, revisit the first two slides before moving to Part 2.
π Explained for complete beginners
Before Part 2, test yourself by answering aloud, in your own words and without the slides: why can't a maintenance engineer learn one number system and skip the other three?
A complete answer has three points. The computer inside always works in binary. The pilot's display shows easy-to-read decimal or BCD. Maintenance documents and fault logs use hex because it is compact and less error-prone to look up. If you can say all three fluently, you are ready for Part 2.
PART 2/5
02
Binary numbers and conversion
Bit weighting: MSB/LSB, powers of two
Decimal β binary conversion by repeated division/multiplication
Two's complement for representing negative numbers
PART 2/5 Β· 01
MSB, LSB and powers-of-two weighting
In a binary number, the leftmost bit is the MSB (Most Significant Bit: highest weight), the rightmost bit is the LSB (Least Significant Bit: weight 2β°=1).
2β·
2βΆ
2β΅
2β΄
2Β³
2Β²
2ΒΉ
2β°
128
64
32
16
8
4
2
1
π Explained for complete beginners
MSB (Most Significant Bit) is the bit with the largest weight and LSB (Least Significant Bit) is the bit with the smallest. They play the role of the "hundreds place" and the "units place" in a decimal number. In 110100, the leftmost bit (MSB) has weight 2β΅ = 32 and the rightmost bit (LSB) has weight 2β° = 1.
The table of powers of two (1, 2, 4, 8, 16, 32, 64, 128) is the multiplication table of binary. Learn these eight values and every binary-to-decimal conversion on the following slides becomes quick.
PART 2/5 Β· 01
Worked example: binary β decimal
Convert 11011010β to decimal: sum the weights of bits that are 1:
11011010 = 128+64+0+16+8+0+2+0 = 218
(This is Tooley's own worked example: only add weights where the bit is 1, skip positions with 0.)
π Explained for complete beginners
The rule fits on one line: add the weights of positions holding a 1 and skip positions holding a 0. Do not subtract or multiply, just leave those positions out.
In 11011010, the positions holding 1 carry weights 128, 64, 16, 8 and 2. The two positions holding 0 (weights 32 and 1) are skipped. The sum is 128+64+16+8+2 = 218. A quick check: count the 1-bits in the original string (five here) and count the terms you added. If the counts differ, you skipped or double-counted a weight.
PART 2/5 Β· 01
Worked example: decimal β binary by repeated division
Convert 45 to binary by repeatedly dividing by 2, reading remainders bottom-up:
Division
Quotient
Remainder
45Γ·2
22
1
22Γ·2
11
0
11Γ·2
5
1
5Γ·2
2
1
2Γ·2
1
0
1Γ·2
0
1
Reading remainders bottom-up: 101101 (matches the result independently verified in notebook 01).
π Explained for complete beginners
This method runs opposite to the previous slide. Instead of adding weights, divide the decimal number by 2 again and again, noting the remainder (always 0 or 1) each time, and stop when the quotient reaches 0.
For 45: 45Γ·2 = 22 r 1; 22Γ·2 = 11 r 0; 11Γ·2 = 5 r 1; 5Γ·2 = 2 r 1; 2Γ·2 = 1 r 0; 1Γ·2 = 0 r 1. The usual slip is the reading order: read the remainders bottom to top to get 101101, because the first remainder is the least significant bit and the last is the most significant.
PART 2/5 Β· 01
A faster shortcut: sum weights 2β± directly (no division needed)
45 = 32+8+4+1 β mark 1 at exactly those four weight positions (32,8,4,1), 0 elsewhere β 101101. This shortcut is faster by hand, but the division method on the previous slide is the GENERAL method that also works for octal/hex.
π Explained for complete beginners
This shortcut also reverses binary-to-decimal: we look for the weights that add up to the given number. For 45, subtract the largest weight that still fits: 45-32 = 13, 13-8 = 5, 5-4 = 1, 1-1 = 0. So the weights 32, 8, 4 and 1 get a 1, while 64, 16 and 2 get a 0, giving 101101, the same as the previous slide.
It is fast for small numbers done in your head. Repeated division is the reliable method that never skips a step, especially for large numbers or under exam pressure.
PART 2/5 Β· 01
Binary addition: the carry rule
1-bit addition table
0+0=0 Β· 0+1=1 Β· 1+0=1 Β· 1+1=10 (carry 1)
Example: 0110 + 0101 = 1011 (6+5=11: cross-check in decimal to confirm the carry rule was applied correctly).
Click the image to enlargeπ Explained for complete beginners
The binary addition table has only four cases (the decimal table has 100): 0+0 = 0, 0+1 = 1, 1+0 = 1, and the special case 1+1 = 10, read as "write 0, carry 1", just like "9+1 = 10, write 0 carry 1" in decimal.
The circuit that performs exactly this addition is the half adder. The figure shows it needs only two gates: an XOR gate giving the sum Ξ£ = AβB (the result before any carry) and an AND gate giving the carry Cout = AB. The AND gate outputs 1 only when both inputs are 1, matching the fact that 1+1 is the only case that produces a carry. You will meet XOR and AND again in Module 02.
PART 2/5 Β· 01
Negative numbers in binary: why two's complement is needed
Pure binary has no minus sign. Negative numbers are represented using two's complement: invert every bit, then add 1. This is how a CPU performs subtraction using only an adder circuit.
π Explained for complete beginners
Ordinary arithmetic puts a minus sign in front of a negative number. Electronic circuits have only two voltage levels (0 and 1), with no third level left over to stand for a sign.
CPU designers solved this with two's complement, a bit transformation built so that adding a number to another number's two's complement gives exactly the result of subtraction. A CPU therefore needs only one adder circuit to do both addition and subtraction, which saves a good deal of hardware inside the chip.
PART 2/5 Β· 01
Worked example: two's complement of 10110
Step 1: invert bits: 10110 β 01001.
Step 2: add 1: 01001 + 1 = 01010.
(Matches the original Tooley Ch.2 Q3: see the Module 01 quiz.)
π Explained for complete beginners
Two's complement takes two steps, in order. Step 1: invert every bit (0 becomes 1, 1 becomes 0), so 10110 becomes 01001. Step 2: add 1, so 01001 + 1 = 01010. Therefore 01010 is the two's complement of 10110, meaning the matching negative value.
You can check it without a table: add the original to the result, 10110 + 01010 = 100000. Drop the overflow bit and you get 00000, which confirms the answer, since a number plus its own negative must equal zero.
PART 2/5 Β· 01
β οΈ Trap: forgetting the '+1' step after inverting
The most common error is inverting the bits and STOPPING there: that is one's complement, not two's complement. Always verify by adding the original number to its two's complement: if the sum overflows past the original bit width (e.g. 10110+01010=100000, drop the overflow bit β 00000), the result is correct.
π Explained for complete beginners
This is the most common mistake when learning two's complement: performing only Step 1 (inverting the bits) and stopping, believing the job is done. That result is one's complement, a different concept that most modern systems do not use for negative numbers.
The one's complement of 10110 is just 01001, while the correct two's complement is 01010. To catch a forgotten +1, always run the addition check from the previous slide. If the sum is not zero after dropping the overflow bit, you almost certainly forgot to add 1.
PART 2/5 Β· 01
Application on the A320: why the ADIRU outputs signed binary data
The ADIRU (Air Data Inertial Reference Unit) must represent both positive values (climbing altitude) and negative values (decreasing speed/negative pitch angle): two's complement lets the FMGC add/subtract these using a single adder circuit, with no separate subtractor needed.
Click the image to enlargeπ Explained for complete beginners
The ADIRU (Air Data Inertial Reference Unit) measures values that can rise or fall continuously in flight: altitude rising in the climb, airspeed dropping under braking, pitch angle positive or negative. Without two's complement the system would need one adder for positive values and a separate subtractor for negative ones, doubling the hardware.
With two's complement, the FMGC needs just one binary adder to handle both directions of every flight value. The attached image shows how all A320 sensor data follows this binary principle.
PART 2/5 Β· 01
Quick self-check (ungraded)
Try mentally: what is the two's complement of the 4-bit binary number 0110? (Hint: invert to 1001, add 1 β 1010.) If you got something else, review the two-step process above.
π Explained for complete beginners
Try this before Part 3: find the two's complement of the 4-bit number 0110 without looking at the hint. Recall the two steps: invert the bits (0110 becomes 1001), then add 1 (1001 + 1 = 1010).
If you got 1010, check it by addition: 0110 + 1010 = 10000, drop the overflow bit and you have 0000, as expected. If you got something else, you probably stopped at the inversion step (1001) and forgot the +1, which is exactly the trap on the previous slide. Review that slide and try again.
PART 3/5
03
Octal and hexadecimal
Group of 3 bits β 1 octal digit, group of 4 bits β 1 hex digit
Applications: system status codes (octal), memory addresses/BITE fault codes (hex)
PART 3/5 Β· 01
Why octal groups 3 bits and hex groups 4 bits
2Β³=8, so each octal digit represents exactly 3 bits; 2β΄=16, so each hex digit represents exactly 4 bits. This is NOT an arbitrary convention: it follows directly from the definition of the base itself.
π Explained for complete beginners
The answer lies in exponents. 2Β³ = 8 means 3 bits can represent exactly 8 values (000 to 111), which matches the 8 octal digits (0 to 7). So each octal digit corresponds to exactly 3 bits. Likewise 2β΄ = 16 matches the 16 hex symbols (0-9 and A-F), so each hex digit corresponds to exactly 4 bits.
This is not an arbitrary convention but a mathematical consequence. Grouping the wrong number of bits, say 3 bits mapped to a hex digit, gives a wrong conversion immediately.
PART 3/5 Β· 01
Quick reference table: binary β hex (must be memorised)
Hex
Binary
Hex
Binary
0
0000
8
1000
1
0001
9
1001
2
0010
A
1010
3
0011
B
1011
4
0100
C
1100
5
0101
D
1101
6
0110
E
1110
7
0111
F
1111
π Explained for complete beginners
This table is the most important tool in Part 3. It lists all 16 hex values with their exact 4-bit patterns. Because each hex digit always maps to one fixed 4-bit pattern, you convert by lookup with no further calculation. That is why binary-to-hex is faster and less error-prone than going through decimal.
A practical tip: copy the table by hand a few times until you remember A=1010, B=1011, C=1100, D=1101, E=1110 and F=1111. Those six values are where beginners slip most often.
PART 3/5 Β· 01
Worked example: binary β octal by grouping 3 bits
Convert 100010001β to octal: group from the right in 3s: 100 | 010 | 001 β 4 2 1 β 421β. (Matches Tooley Ch.2 Q8.)
π Explained for complete beginners
The group-in-3s procedure applies the 2Β³ = 8 principle from the first slide of this part. Split 100010001 into groups of 3 bits, starting from the right: 100 | 010 | 001. Look each group up in the octal table (000 = 0, 001 = 1, 010 = 2, ..., 111 = 7) to get 4, 2, 1 and join them as 421β.
The most common mistake is grouping from the left. Every group is then misaligned and the answer is wrong, especially when the bit count is not divisible by 3 (see the padding slide later).
PART 3/5 Β· 01
Worked example: hex β octal MUST go through binary
111ββ β expand each hex digit to 4 bits: 1β0001, 1β0001, 1β0001 β 000100010001β.
Regroup in 3s from the right: 000 100 010 001 β 4 2 1 β 421β. You cannot infer hexβoctal directly, skipping this step.
π Explained for complete beginners
There is no single-step formula from hex to octal. You always go through binary, in two stages.
Stage 1: expand each hex digit to exactly 4 bits: 1β0001, 1β0001, 1β0001, joined as 000100010001. Stage 2: regroup that string in 3s from the right: 000 100 010 001, which reads 4, 2, 1, so 421β. If you try to guess "which octal digit matches hex F" and skip the binary step, you will almost always be wrong, because the two systems have no simple divisibility relationship.
PART 3/5 Β· 01
Worked example: binary β hex by grouping 4 bits
Convert 10110011β to hex: group in 4s: 1011 | 0011 β B | 3 β B3ββ. (Matches Tooley Ch.2 Q11.)
π Explained for complete beginners
Grouping in 4s for hex works exactly like grouping in 3s for octal, only the group size changes. Split 10110011 into two 4-bit groups from the right: 1011 | 0011. Look up the hex table to get B (1011) and 3 (0011), joined as B3ββ.
A memory aid: B is one step after A = 10, so B = 11 = 1011 in binary. With practice you will stop needing the table. Always group from right to left, the same caveat as on the 3-bit slide.
PART 3/5 Β· 01
Padding with leading zeros when bit count isn't divisible
Convert 111001110β (9 bits) to octal: 9 is already divisible by 3, so group directly: 111 001 110 β 7 1 6 β 716β. Always count the bits first and pad with LEADING zeros if the count is not a multiple of the group size.
π Explained for complete beginners
Before grouping bits, always count the total number of bits to see whether padding is needed: octal needs a multiple of 3, hex needs a multiple of 4. With 111001110 (exactly 9 bits, already a multiple of 3) group directly: 111 001 110, which reads 7, 1, 6, so 716β.
If the count does not divide evenly, say 7 bits grouped by 3, add zeros on the left, not the right. Leading zeros never change a value, just as 007 equals 7 in decimal. Zeros added on the right would change the value completely.
PART 3/5 Β· 01
Why hex dominates over octal in modern systems
Most modern data buses (8/16/32-bit) are multiples of 4, so hex groups fit exactly with no padding, while octal (groups of 3) often misaligns with common bus widths. This is why hex dominates modern maintenance documentation over octal.
π Explained for complete beginners
Most data buses in modern computers and avionics are 8, 16 or 32 bits wide. These are multiples of 4, so they split into hex digits with nothing left over, but they are not always multiples of 3. A 16-bit register splits into exactly 4 hex digits, while splitting it into octal digits leaves one stray bit that needs padding, which is a nuisance when programming or reading logs.
This practical reason explains why hex gradually replaced octal in modern technical and maintenance documents, although octal survives in a few legacy systems.
PART 3/5 Β· 01
β οΈ Trap: adding/subtracting hex digits as if they were decimal
Never add '9'+'9'=18 and write '18' into a hex result: hex only has 16 symbols (0-F). 9+9=18 (decimal) = 12ββ, written as digit 2 with a carry of 1. Convert through decimal to add if you are not yet fluent with the hex addition table.
π Explained for complete beginners
People used to decimal arithmetic can carry that habit into hex, adding 9+9 to get 18 and writing "18" straight into the answer. But hex has only 16 symbols (0-9 and A-F), and there is no symbol "18".
The right way: 9+9 = 18 in decimal, and 18 in hex is 12ββ (since 18 = 16+2). So write the digit 2 in that column and carry 1 to the next column on the left, the same carry principle as binary addition. Until the hex addition table feels natural, the safe approach is to convert the hex digits to decimal, add, and convert the result back to hex.
PART 3/5 Β· 01
Application on the A320: BITE fault codes are always shown as 4-digit hex
A fault code such as 0xACDE corresponds to exactly 16 bits of binary (4 hex digits Γ 4 bits). Technicians looking it up in the AMM don't need to count 16 individual bits: matching 4 hex characters is enough, drastically reducing misreading compared with a long binary string.
Click the image to enlargeπ Explained for complete beginners
BITE (Built-In Test Equipment) is the subsystem that detects faults on the aircraft automatically. Every fault code it produces is written as 4 hex characters, for example 0xACDE, because 4 hex characters match exactly 16 bits, enough to encode tens of thousands of fault types without a long string of digits.
When looking the code up in the AMM (Aircraft Maintenance Manual), the technician only has to match 4 hex characters, which is much faster and less error-prone than counting and comparing 16 bits by eye. The attached image shows the whole chain of real uses: memory addresses, ARINC 429 data labels and maintenance fault codes, all in hex for the same reason.
PART 3/5 Β· 01
Quick self-check (ungraded)
Without a calculator: what is 2Fββ in binary? (Hint: 2β0010, Fβ1111 β 00101111.) Check against the reference table at the start of this part if unsure.
π Explained for complete beginners
Self-check: convert 2Fββ to binary with no calculator and no table. Split the hex digits, turn 2 into 0010, turn F into 1111 (F is the largest hex value, so every bit is set), and join the two groups in order: 00101111.
If you got a different answer, return to the quick-reference table at the start of Part 3 to find which group you remembered wrongly, then try a similar example until you can do it without the table.
PART 4/5
04
BCD and ASCII codes
BCD: each decimal digit β its own 4-bit group
BCD on MCDU input panels and 7-segment displays
ASCII: character encoding for text data exchange
PART 4/5 Β· 01
How is BCD different from pure binary?
Pure binary converts the WHOLE number at once; BCD converts EACH decimal digit separately into 4 bits. BCD therefore always uses more bits than pure binary for the same value, in exchange for a trivially simple conversion to 7-segment display.
π Explained for complete beginners
The core difference is what unit gets converted. Pure binary treats the whole number as one block and converts it once (45 becomes 101101). BCD splits the number into decimal digits and converts each digit into 4 bits.
For 45, pure binary gives 101101 (6 bits) while BCD gives 0100 0101 (8 bits, built from 4β0100 and 5β0101). So BCD always spends more bits on the same value. In exchange, a 7-segment display needs only a simple decoder per 4-bit group, whereas pure binary would need a much more complex circuit to split the value back into decimal digits.
PART 4/5 Β· 01
Conversion table: 10 decimal digits β BCD
Digit
BCD
Digit
BCD
0
0000
5
0101
1
0001
6
0110
2
0010
7
0111
3
0011
8
1000
4
0100
9
1001
π Explained for complete beginners
The table lists just 10 combinations, one per decimal digit. The hex table in Part 3 had 16. This is the core difference between BCD and hex, and it returns on the "trap" slide later.
The table is easy to learn because it matches ordinary binary counting from 0000 to 1001, only stopping earlier. Plain 4-bit binary counts up to 1111 = 15, while BCD stops at 1001 = 9. Remembering that stopping point is the fastest way to tell whether a pattern is valid BCD.
PART 4/5 Β· 01
Worked example: decimal β BCD
Convert 37 to BCD: encode each digit separately: 3β0011, 7β0111 β concatenate 00110111. (Matches Tooley Ch.2 Q5.)
π Explained for complete beginners
The procedure has one step: split the decimal digits apart, then convert each digit to 4 bits using the table on the previous slide. No calculation like converting to pure binary is needed.
For 37: digit 3 becomes 0011 and digit 7 becomes 0111. Join them in the original order (tens first, then units) to get 00110111. Note that this is not converting 37 to pure binary, which would give 100101, only 6 bits. The two conversions serve different purposes, so do not mix them up.
PART 4/5 Β· 01
Worked example: BCD β decimal
Convert 10010001 (BCD) to decimal: split into 4-bit groups from the right: 1001 | 0001 β 9 | 1 β 91. (Matches Tooley Ch.2 Q4.)
π Explained for complete beginners
This reverses the previous slide. Starting from a BCD bit string, first split it into groups of exactly 4 bits from the right, the same grouping used for hex. Then look up each group to get one decimal digit.
For 10010001: split into 1001 | 0001, look up 9 and 1, and join them in order to get 91. If you meet a group outside 0000 to 1001 while splitting (for example 1010 or 1111), the string is not valid BCD. The next slide says more about those patterns.
PART 4/5 Β· 01
The 6 invalid BCD combinations
4-bit BCD has 16 possible patterns (0000-1111) but only 10 (0000-1001) are valid. The six patterns 1010-1111 do NOT correspond to any decimal digit: if a BCD decoder circuit encounters these, it signals a hardware fault or data corruption.
π Explained for complete beginners
With 4 bits you can form 2β΄ = 16 patterns (0000 to 1111), but BCD uses only the first 10 (0000 to 1001) for the 10 decimal digits. The remaining six patterns (1010, 1011, 1100, 1101, 1110, 1111) mean nothing in BCD.
This is not harmless. If a BCD circuit, such as a 7-segment decoder, receives one of those "garbage" patterns, something is definitely wrong: a hardware fault, signal noise or corrupted data in transit. Many onboard self-test systems (BITE) exploit exactly this property to detect corrupted BCD data.
PART 4/5 Β· 01
ASCII: encoding characters, not encoding a quantity
Standard ASCII uses 7 bits, representing 128 characters (letters, digits, punctuation, control characters). Note: the ASCII code for the character '5' (0110101β = 35ββ) is COMPLETELY DIFFERENT from the binary number representing the value 5 (00000101β): these are two independent encoding concepts.
π Explained for complete beginners
Two concepts are often mixed up. Encoding a quantity (binary, BCD) says how much. Encoding a character (ASCII) says which letter, text digit, punctuation mark or control command it is.
Standard ASCII uses 7 bits, enough for 2β· = 128 characters: upper and lower case letters, digits and invisible control characters such as newline and tab. The point that trips people most: the ASCII code for the character '5' is 0110101β, quite different from the binary number for the value 5, which is 00000101β. One describes a symbol to display, the other a quantity to calculate with.
PART 4/5 Β· 01
Example: the ASCII code for the letter 'A'
'A' = 65 (decimal) = 41ββ = 1000001β. The text string 'TCAS' is transmitted as 4 consecutive ASCII bytes, not as a single number.
π Explained for complete beginners
A concrete example for the character 'A': its ASCII code is 65 in decimal, 41ββ in hex and 1000001β in binary (exactly 7 bits under the ASCII standard).
When a system transmits the string 'TCAS' (Traffic Collision Avoidance System), it does not send one number for the whole word. It sends 4 separate ASCII bytes, one each for T, C, A and S. That is why raw data in a debugging tool may show the hex sequence 54 43 41 53, and you need to recognise it as the text 'TCAS' rather than a single binary number.
PART 4/5 Β· 01
β οΈ Trap: confusing BCD with hex when looking at an isolated 4-bit group
Both BCD and hex group data in 4 bits, which is easy to confuse. The key difference: hex has all 16 valid 4-bit values (0-F), while BCD only has 10 valid values (0-9): always ask what the context is (an address/hex value, or a decimal digit/BCD) before interpreting a 4-bit group.
π Explained for complete beginners
BCD and hex both group data in 4-bit clusters, so at a glance they are easy to confuse. The group 0111 reads as 7 either way, so no problem shows up. Try 1100 instead: it is a valid 'C' in hex but an invalid pattern in BCD.
The core distinction: hex has all 16 values valid (0 to F), while BCD has only 10 valid values (0 to 9), and the other six are garbage. The safe rule: before interpreting a 4-bit group, always find the context in the accompanying documentation (an address in hex, or a BCD digit), and never guess from the bit pattern alone.
PART 4/5 Β· 01
Application on the A320: why the MCDU keypad enters data in BCD
When a pilot types an altitude/speed on the MCDU, the keypad generates a BCD code for each keystroke: the CPU only needs to split 4-bit groups to know each digit exactly, far simpler than decoding one large binary number and then splitting it back into decimal digits.
Click the image to enlargeπ Explained for complete beginners
When a pilot types a number on the MCDU (Multi-purpose Control and Display Unit) keypad to enter an altitude or speed, each digit key produces the BCD code of that exact digit. The whole number is not encoded into pure binary at the start.
The practical benefit: the processor only has to split the 4-bit groups to know exactly which digit was typed. That is much simpler than receiving one large binary number and running an algorithm to split it back into decimal digits. The attached image shows the process: the pilot enters 350 on the MCDU, and each digit is BCD-encoded (3β0011, 5β0101, 0β0000).
PART 4/5 Β· 01
Quick self-check (ungraded)
What is 68 (decimal) in BCD? (Hint: 6β0110, 8β1000.) Compare your answer with the practice question bank at the bottom of the page after trying it yourself.
π Explained for complete beginners
Practice: convert 68 (decimal) to BCD without looking at the table. Split the digits 6 and 8, convert each (6β0110, 8β1000), and join them in order (tens first) to get 01101000.
This is the last exercise of Part 4 before the multiple-choice questions at the bottom of the page. If you finish it fluently, you have covered all four theory parts (decimal, binary, octal and hex, BCD and ASCII) and are ready for Part 5, which ties everything together with real A320 examples.
PART 5/5
05
Application on the Airbus A320
ARINC 429 bus data is transmitted in binary, logged/displayed in hex
ECAM/EWD display BCD-coded N1, EGT, altitude
BITE fault codes are shown in hex (e.g. 0xACDE)
PART 5/5 Β· 01
The full picture: how many number systems does one altitude value pass through?
Barometric sensor (analog) β ADC β 16-bit binary inside the ADIRU/FMGC β BCD-encoded for the PFD display β possibly logged in hex if a sensor fault occurs. A SINGLE physical quantity (altitude) passes through at least 3 different number systems before reaching the pilot's/engineer's eyes.
π Explained for complete beginners
This slide ties the four earlier parts into one story. Follow a single altitude value from birth to display. A barometric sensor produces a continuous analog signal. The ADC samples it and digitises it into a 16-bit binary string. Inside the ADIRU and FMGC that string is calculated and corrected. Finally the result is re-encoded as BCD so the PFD (Primary Flight Display) can show familiar digits to the pilot.
If a sensor fault occurs, the system also records a hex-coded log entry for engineers to look up later. One physical value, at least three number systems.
PART 5/5 Β· 01
Worked example: 10,000 ft as a 16-bit binary value
10,000 (decimal) β binary using the repeated-division-by-2 method learned in Part 2: 10000, 5000, 2500, 1250, 625, 312, 156, 78, 39, 19, 9, 4, 2, 1, 0. Reading the remainders bottom-up and zero-padding to 16 bits gives 0010011100010000β. This is the raw data the FMGC processes internally.
π Explained for complete beginners
This exercise reuses the repeated division by 2 from Part 2: convert 10,000 (feet) to binary. The 16-bit result is 0010011100010000, zero-padded at the front because aircraft computer registers usually have fixed widths that are multiples of 8.
A quick hex check: grouping in 4s gives 0010 | 0111 | 0001 | 0000, which is 2710ββ, and 2710ββ = 2Γ4096 + 7Γ256 + 1Γ16 = 10,000. This bit string is the raw data the FMGC stores and computes with, quite unlike the familiar 10,000 on the display, which was re-encoded to BCD before being shown.
PART 5/5 Β· 01
Example: ARINC 429 bus data shown in hex in maintenance logs
A 32-bit ARINC 429 data word, when logged for maintenance, is shortened to 8 hex characters instead of 32 binary characters: engineers read the log far faster, a direct real application of the hex conversion learned in Part 3.
π Explained for complete beginners
ARINC 429 is a widely used avionics data standard in which each data word is exactly 32 bits. Writing all 32 binary characters into a maintenance log would fill a page with hard-to-read 0s and 1s.
So the system groups the bits in 4s (the principle from Part 3) and shortens them to 8 hex characters. Engineers read 8 hex characters far faster than they can count and compare 32 bits, and misread them less often. This is the practical reason given in Part 1 on why technicians do not read long binary strings.
PART 5/5 Β· 01
Example: EGT shown as BCD on the ECAM
Engine exhaust gas temperature (EGT), e.g. 650Β°C, is BCD-encoded (6-5-0) before being sent to the 7-segment display driver on the ECAM: exactly the BCDβ7-segment principle learned in Part 4, avoiding a complex binary-to-decimal decoder.
π Explained for complete beginners
EGT (Exhaust Gas Temperature) is a perfect example of BCD driving a 7-segment display. The value 650Β°C splits into three digits 6, 5, 0, each converted to BCD (6β0110, 5β0101, 0β0000). Each 4-bit group goes straight into a simple 7-segment decoder that lights the right segments on the ECAM screen.
If the system used pure binary here, a far more complex circuit would be needed to split one binary number back into decimal digits. That is why BCD remains popular for displays despite using more bits.
PART 5/5 Β· 01
Summary table: which number system is used where on the A320
Location in the system
Number system
Internal processing in FMGC/FWC/SDAC
Binary
EGT, N1, altitude display on ECAM
BCD
BITE fault codes, maintenance logs
Hex
Some legacy status pages (MCDU STATUS)
Octal
π Explained for complete beginners
The table collects the four conclusions from the four earlier parts so you can see the whole picture. Binary handles all internal calculation because the hardware understands only two voltage levels. BCD is used when familiar figures (EGT, N1, altitude) must be shown to pilots. Hex serves fault codes and maintenance logs because it is compact and low-error to look up. Octal survives only on some legacy status pages.
Treat the table as a quick lookup map. When you meet an unfamiliar number in technical documents, first identify where in the system it appears, and you can infer which number system is probably in use.
PART 5/5 Β· 01
Why maintenance staff cannot round off when reading hex
Unlike a decimal value (where rounding is often acceptable), a hex fault code read WRONG BY EVEN ONE CHARACTER (e.g. looking up 0xACDE instead of 0xACDF) leads to a COMPLETELY WRONG AMM lookup: there is no concept of 'close enough' when working with system hex codes.
π Explained for complete beginners
With an ordinary decimal value, rounding 250.4 to 250 rarely causes real harm. A hex fault code is different. If an engineer misreads 0xACDE as 0xACDF (one final character off), the AMM lookup could point to two entirely different faults.
The result is the wrong part repaired, lost time and money, and, most importantly, the real fault left unfixed. That is why maintenance procedures require copying a hex code exactly and completely, with no estimating or rounding.
PART 5/5 Β· 01
β οΈ Trap: misreading byte order (endianness) when assembling hex
Some systems log data in reversed byte order (little-endian) compared with the intuitive reading order (big-endian). Before concluding a hex fault code's meaning, ALWAYS check that specific system's AMM for the byte order it specifies: never assume a default.
π Explained for complete beginners
"Endianness" is the order in which the bytes of a multi-byte value are stored or sent. Big-endian stores the most significant byte first, which matches the way people naturally read. Little-endian stores the least significant byte first, which feels backwards.
If an engineer used to reading big-endian assumes that order while the system logs in little-endian, joining the hex bytes in the wrong order produces a fault code very different from the real one, and the AMM lookup goes wrong as on the previous slide. The safe rule: never assume a byte order. Check the documentation of the specific system you are working on.
PART 5/5 Β· 01
Extra case: octal conversion for a legacy STATUS page
Some older-generation MCDUs display the STATUS PAGE using a 3-digit octal code. For example, code 657β corresponds to binary 110101111β: the engineer must regroup by 3 bits, exactly as learned in Part 3, to correctly look up the status meaning.
Click the image to enlargeπ Explained for complete beginners
Although hex has replaced octal in most modern systems, some older MCDUs still show status codes in octal, a holdover from designs decades old. The attached image shows this kind of octal use on the A320.
For the code 657β, use the octal-to-binary table already learned (6β110, 5β101, 7β111) and join the groups to get 110101111β, the actual bit string the system handles inside. The practical lesson: engineers working on older aircraft still need fluency in both octal and hex.
PART 5/5 Β· 01
Why this is the FOUNDATION module for everything that follows
Module 02 (logic gates) will reuse binary truth tables; Module 03 (multiplexers) will use binary/hex channel-select addresses; Module 04 (CPU) will use hex memory addresses and binary opcodes. Mastering all four number systems here is a prerequisite for correctly understanding the next three modules.
π Explained for complete beginners
A look ahead. Module 02 on logic gates will constantly use truth tables written in 0s and 1s to describe the inputs and outputs of AND, OR and NOT gates. Module 03 on multiplexers will use channel-select addresses in binary or hex. Module 04 on CPUs will use hex memory addresses and binary opcodes.
If the four number systems and their conversions are not solid yet, you will stumble right at the start of Module 02, because every example there assumes you read and write binary and hex naturally, without stopping to work things out step by step.
PART 5/5 Β· 01
Final module self-check (ungraded)
Before taking the quiz below: can you convert any given number through all four systems (decimalβbinaryβoctalβhexβBCD) without looking back at any slide? If any step is still shaky, revisit that specific part above before starting the quiz.
π Explained for complete beginners
This is the final self-check for the whole module. Pick any number, say 91, and convert it through all four systems in turn without opening a slide. Decimal to binary by repeated division by 2 (91 = 1011011β). Binary to octal by grouping that string in 3s. Binary to hex by grouping the same string in 4s, not from the octal result. Finally, split the original decimal digits and convert each to BCD (9β1001, 1β0001).
If you get through the whole chain fluently, you are ready for the multiple-choice questions below. If you stall at any step, go back to that part above first.
PART 2-3 Β· Formula
Base conversion by repeated division (decimal β base b)
Base conversion by repeated division (decimal β base b)
Nββ = Ξ£ dα΅’ Β· bβ± β divide N by b repeatedly, read remainders in reverse order
π Real case study: reading a BITE fault code on the Airbus A320
When an LRU (Line Replaceable Unit) on the A320 detects a fault, the BITE system generates a fault code shown in hex on the MCDU/ECAM (e.g. 0xACDE). Maintenance technicians look this code up in the AMM (Aircraft Maintenance Manual) to identify the LRU and root cause. Displaying hex instead of the full 16-bit binary string (1010 1100 1101 1110) significantly shortens lookup time and reduces manual transcription errors.
β οΈ warn
β οΈ Common trap
The most common mistake is converting directly between hex and octal without going through binary. Because hex groups bits in 4s while octal groups them in 3s, the two groupings do NOT line up: always expand to full binary first, then regroup for the target base, as illustrated in question 9 below (111ββ β 421β cannot be inferred directly).
π Real case study: reading a BITE fault code on the Airbus A320
When an LRU (Line Replaceable Unit) on the A320 detects a fault, the BITE system generates a fault code shown in hex on the MCDU/ECAM (e.g. 0xACDE). Maintenance technicians look this code up in the AMM (Aircraft Maintenance Manual) to identify the LRU and root cause. Displaying hex instead of the full 16-bit binary string (1010 1100 1101 1110) significantly shortens lookup time and reduces manual transcription errors.
β οΈ Common trap
The most common mistake is converting directly between hex and octal without going through binary. Because hex groups bits in 4s while octal groups them in 3s, the two groupings do NOT line up: always expand to full binary first, then regroup for the target base, as illustrated in question 9 below (111ββ β 421β cannot be inferred directly).
π Companion Python notebook
Companion notebook: a Python base-converter (decimal/binary/octal/hex/BCD) that re-checks all 13 original Tooley textbook questions by code instead of by hand: plus a section that auto-solves all 69 end-of-chapter Problems from Floyd Chapter 2.
Book 1: Mike Tooley, Aircraft Digital Electronic and Computer Systems (end-of-chapter MCQs, independently recomputed to verify each answer)
Book 2: Thomas Floyd, Digital Fundamentals (True/False Quiz + Self-Test, cross-checked against the bookβs own printed answer key)
Additional practice questions (AI-authored in the same style, answers self-verified by computation)
βοΈ Free-response questions (source: Floyd, Digital Fundamentals)
Thomas L. Floyd, Digital Fundamentals, 11th ed., Chapter 2 β Number Systems, Operations, and Codes, Problems (p.117-121); answers in the Answers to Odd-Numbered Problems appendix (p.A-1, A-2).
Chapter 2 has 69 problems; only the ODD-numbered ones have printed answers. All 35 odd problems are included here, each with the real answer image; every numeric answer was recomputed in Python. The cross-check found 3 REAL PRINTING ERRORS in the book's answers: Problems 5(c), 29(b) and 37(g), flagged directly under each problem. Even-numbered problems have no printed answer and are omitted.
1. What is the weight of 7 in each of the following decimal numbers? (a) 1947 (b) 1799 (c) 1979
Self-check: 7 is in the units (1), hundreds (100) and tens (10) positions respectively, matching the printed answer.
Floyd Ch.2 Β· Problem 1
ποΈ Show the book's original answer
3. Give the value of each digit in the following decimal numbers: (a) 263 (b) 5436 (c) 234543
Self-check: each digit times its positional weight, matching the printed answer.
Floyd Ch.2 Β· Problem 3
ποΈ Show the book's original answer
5. Convert the following binary numbers to decimal: (a) 001 (b) 010 (c) 101 (d) 110 (e) 1010 (f) 1011 (g) 1110 (h) 1111
A REAL PRINTING ERROR in the book: item (c) 101β = 4+0+1 = 5, but the printed answer says 3. All other items (1, 2, 6, 10, 11, 14, 15) are correct. Do not memorise the 3.
Floyd Ch.2 Β· Problem 5
ποΈ Show the book's original answer
7. Convert each binary number to decimal: (a) 110011.11 (b) 101010.01 (c) 1000001.111 (d) 1111000.101 (e) 1011100.10101 (f) 1110001.0001 (g) 1011010.1010 (h) 1111111.11111
Floyd Ch.2 Β· Problem 7
ποΈ Show the book's original answer
9. How many bits are required to represent the following decimal numbers? (a) 5 (b) 10 (c) 15 (d) 20 (e) 100 (f) 120 (g) 140 (h) 160
Recomputed independently in Python (verify_ch2.py in ocr/floyd/scripts); matches the printed answer. (minimum bits = binary length of the number).
Floyd Ch.2 Β· Problem 9
ποΈ Show the book's original answer
11. Convert each decimal number to binary by using the sum-of-weights method: (a) 12 (b) 15 (c) 25 (d) 50 (e) 65 (f) 97 (g) 127 (h) 198
Recomputed independently in Python (verify_ch2.py in ocr/floyd/scripts); matches the printed answer.
Floyd Ch.2 Β· Problem 11
ποΈ Show the book's original answer
13. Convert each decimal number to binary using repeated division by 2: (a) 13 (b) 17 (c) 23 (d) 30 (e) 35 (f) 40 (g) 49 (h) 60
Recomputed independently in Python (verify_ch2.py in ocr/floyd/scripts); matches the printed answer.
Floyd Ch.2 Β· Problem 17
ποΈ Show the book's original answer
19. What are two ways of representing zero in 1's complement form?
Check by definition: 00000000 and its bit-inversion 11111111 ("negative zero") both represent 0.
Floyd Ch.2 Β· Problem 19
ποΈ Show the book's original answer
21. Determine the 1's complement of each binary number: (a) 100 (b) 111 (c) 1100 (d) 10111011 (e) 1001010 (f) 10101010
Floyd Ch.2 Β· Problem 21
ποΈ Show the book's original answer
23. Express each decimal number in binary as an 8-bit sign-magnitude number: (a) +29 (b) β85 (c) +100 (d) β123
Recomputed independently in Python (verify_ch2.py in ocr/floyd/scripts); matches the printed answer.
Floyd Ch.2 Β· Problem 23
ποΈ Show the book's original answer
25. Express each decimal number as an 8-bit number in the 2βs complement form: (a) +12 (b) β68 (c) +101 (d) β125
Floyd Ch.2 Β· Problem 25
ποΈ Show the book's original answer
27. Determine the decimal value of each signed binary number in the 1's complement form: (a) 10011001 (b) 01110100 (c) 10111111
Recomputed independently in Python (verify_ch2.py in ocr/floyd/scripts); matches the printed answer.
Floyd Ch.2 Β· Problem 27
ποΈ Show the book's original answer
29. Express each of the following sign-magnitude binary numbers in single-precision floating-point format: (a) 0111110000101011 (b) 100110000011000
PRINTING ERROR in item (b): by IEEE 754 the value β3096 has mantissa 10000011000 followed by zeros (confirmed with Python's struct.pack), but the printed answer shows 11000001100... (shifted by one place with an extra leading 1). The sign and the exponent 10001010 in the printed answer are correct. Item (a) is fully correct.
Floyd Ch.2 Β· Problem 29
ποΈ Show the book's original answer
31. Convert each pair of decimal numbers to binary and add using the 2's complement form: (a) 33 and 15 (b) 56 and β27 (c) β46 and 25 (d) β110 and β84
Recomputed independently in Python (verify_ch2.py in ocr/floyd/scripts); matches the printed answer. Item (d) needs 9 bits because β194 does not fit in 8 bits.
Floyd Ch.2 Β· Problem 31
ποΈ Show the book's original answer
33. Perform each addition in the 2's complement form: (a) 10001100 + 00111001 (b) 11011001 + 11100111
Recomputed independently in Python (verify_ch2.py in ocr/floyd/scripts); matches the printed answer. (the overflow carry is discarded in item b).
Floyd Ch.2 Β· Problem 33
ποΈ Show the book's original answer
35. Multiply 01101010 by 11110001 in the 2's complement form.
Own calculation: 106 Γ (β15) = β1590; its 12-bit two's complement is 100111001010, matching the printed answer.
Floyd Ch.2 Β· Problem 35
ποΈ Show the book's original answer
37. Convert each hexadecimal number to binary: (a) 4616 (b) 5416 (c) B416 (d) 1A316 (e) FA16 (f) ABC16 (g) ABCD16
PRINTING ERROR in item (g): ABCDββ = 1010 1011 1100 1101 = 1010101111001101, but the printed answer is 1010110010111101 (that is ACBDββ, with the two middle groups swapped). All other items are correct.
Floyd Ch.2 Β· Problem 37
ποΈ Show the book's original answer
39. Convert each hexadecimal number to decimal: (a) 4216 (b) 6416 (c) 2B16 (d) 4D16 (e) FF16 (f) BC16 (g) 6F116 (h) ABC16
Recomputed independently in Python (verify_ch2.py in ocr/floyd/scripts); matches the printed answer.
Recomputed independently in Python (verify_ch2.py in ocr/floyd/scripts); matches the printed answer.
Floyd Ch.2 Β· Problem 41
ποΈ Show the book's original answer
43. Convert each octal number to decimal: (a) 148 (b) 538 (c) 678 (d) 1748 (e) 6358 (f) 2548 (g) 26738 (h) 77778
Recomputed independently in Python (verify_ch2.py in ocr/floyd/scripts); matches the printed answer.
Floyd Ch.2 Β· Problem 43
ποΈ Show the book's original answer
45. Convert each octal number into binary: (a) 178 (b) 268 (c) 1458 (d) 4568 (e) 6538 (f) 7778
Recomputed independently in Python (verify_ch2.py in ocr/floyd/scripts); matches the printed answer.
Floyd Ch.2 Β· Problem 45
ποΈ Show the book's original answer
47. Convert each of the following decimal numbers to 8421 BCD: (a) 10 (b) 13 (c) 18 (d) 21 (e) 25 (f) 36 (g) 44 (h) 57 (i) 69 (j) 98 (k) 125 (l) 156
Recomputed independently in Python (verify_ch2.py in ocr/floyd/scripts); matches the printed answer. The printed answer spans two pages (the image stitches the end of page A-1 and the top of page A-2).
Floyd Ch.2 Β· Problem 47
ποΈ Show the book's original answer
49. Convert the following decimal numbers to BCD: (a) 104 (b) 128 (c) 132 (d) 150 (e) 186 (f) 210 (g) 359 (h) 547 (i) 1051
Floyd Ch.2 Β· Problem 49
ποΈ Show the book's original answer
51. Convert each of the BCD numbers to decimal: (a) 10000000 (b) 001000110111 (c) 001101000110 (d) 010000100001 (e) 011101010100 (f) 100000000000 (g) 100101111000 (h) 0001011010000011 (i) 1001000000011000 (j) 0110011001100111
Recomputed independently in Python (verify_ch2.py in ocr/floyd/scripts); matches the printed answer.
Recomputed independently in Python (verify_ch2.py in ocr/floyd/scripts); matches the printed answer. (add as decimal values, then re-encode as BCD).
Floyd Ch.2 Β· Problem 53
ποΈ Show the book's original answer
55. In a certain application a 4-bit binary sequence cycles from 1111 to 0000 periodically. There are four bit changes, and because of circuit delays, these changes may not occur at the same instant. For example, if the LSB changes first, the number will appear as 1110 during the transition from 1111 to 0000 and may be misinterpreted by the system. Illustrate how the Gray code avoids this problem.
Self-check: in 4-bit Gray code the last code 1000 returns to 0000 by changing exactly one bit, so there is no wrong intermediate state.
Floyd Ch.2 Β· Problem 55
ποΈ Show the book's original answer
57. Convert each Gray code to binary: (a) 1010 (b) 00010 (c) 11000010001
Recomputed independently in Python (verify_ch2.py in ocr/floyd/scripts); matches the printed answer. (MSB kept, each following bit is XORed with the previous binary bit).
Recomputed independently in Python (verify_ch2.py in ocr/floyd/scripts); matches the printed answer. 0011000 = decimal 24 is the control character CAN (Cancel).
Floyd Ch.2 Β· Problem 59
ποΈ Show the book's original answer
61. Write the message in Problem 60 in hexadecimal. Problem 60: Decode the following ASCII coded message: 1001000 1100101 1101100 1101100 1101111 0101110 0100000 1001000 1101111 1110111 0100000 1100001 1110010 1100101 0100000 1111001 1101111 1110101 0111111
The decoded message is "Hello. How are you?" (decoded in Python); converting each character to hex gives the same 19 bytes as the printed answer.
Floyd Ch.2 Β· Problem 61
ποΈ Show the book's original answer
63. Determine which of the following even parity codes are in error: (a) 100110010 (b) 011101010 (c) 10111111010001010
Floyd Ch.2 Β· Problem 63
ποΈ Show the book's original answer
65. Attach the proper even parity bit to each of the following bytes of data: (a) 10100100 (b) 00001001 (c) 11111110
Self-check: count the 1s (3, 2, 7); the parity bit is placed in front of the byte (1, 0, 1) so the total number of 1s is even, as in the printed answer.
Floyd Ch.2 Β· Problem 65
ποΈ Show the book's original answer
67. Verify that modulo-2 subtraction is the same as modulo-2 addition by adding the result of each operation in problem 66 to either of the original numbers to get the other number. This will show that the result is the same as the difference of the two numbers. Problem 66: Apply modulo-2 to the following: (a) 1100 + 1011 (b) 1111 + 0100 (c) 10011001 + 100011100
Own XOR calculation: 1100β1011 = 0111; 1111β0100 = 1011; 10011001β100011100 = 110000101; XORing each result with one original number returns the other.
Floyd Ch.2 Β· Problem 67
ποΈ Show the book's original answer
69. Assume that the code produced in problem 68 incurs an error in the most significant bit during transmission. Apply CRC to detect the error. Problem 68: Apply CRC to the data bits 10110010 using the generator code 1010 to produce the transmitted CRC code.
Own calculation (the book prints no answer for Problem 68): the CRC of 10110010 with 1010 is 110, so the transmitted code is 10110010110. An MSB error gives 00110010110, whose remainder on division by 1010 is 100 (4 bits: 0100), non-zero, so the error is detected, matching the printed answer.