Kits
›
Cómo cuenta un procesador
RU
EN
ES
Contenido
Introduction
History: how machines learned to add
Lesson 1. Gates and the half adder: 1 + 1 = 10
1.1. The idea: adding one digit
1.2. Building
1.3. Check
Lesson 1 paste (Cmd+I)
Lesson 2. The full adder and 4 bits: the carry runs through the digits
2.1. The idea: column addition
2.2. Building
2.3. Check
Lesson 2 paste (Cmd+I)
Lesson 3. Negative numbers and subtraction: two's complement
3.1. The idea: numbers on a circle
3.2. Flags
3.3. Building
3.4. Check
Lesson 3 paste (Cmd+I)
Lesson 4. 8 bits and comparison: CMP is subtraction
4.1. The idea: two halves
4.2. The idea: comparison is subtraction
4.3. Building
4.4. Check
Lesson 4 paste (Cmd+I)
Lesson 5. The ± calculator: the minus on a lamp, the magnitude on the display
5.1. The idea: the magnitude is one more subtraction
5.2. Building
5.3. Check
Lesson 5 paste (Cmd+I)
Lesson 6 (bonus). Decimal math: add six
6.1. The idea: a digit in four bits
6.2. Why the display is in HEX mode
6.3. Building
How to set the digits
6.4. Check
Lesson 6 paste (Cmd+I)
Summary
All the parts
Instructions in pictures
Lesson 6 in pictures
← Back to the lesson: Lesson 6 (bonus). Decimal math: add six
6
Bonus: decimal math
the +6 correction: 38 + 47 = 85
kh
HB-02
A
0
A7
0
A6
1
A5
1
A4
1
A3
0
A2
0
A1
0
A0
B
0
B7
1
B6
0
B5
0
B4
0
B3
1
B2
1
B1
1
B0
3
8
85
D
38 + 47 = 85
IN
9×
OUT
5×
ADDER4
2×
2
OR
2×
1
AND
1×
1
0
16×
1×
4b
0
A
3×
∞
Ctrl
+
G
BCD1
© 2026 Daniil Khanin · khanin.info · HB-02
39
CANVAS
1
Delete
0
A0
0
A1
0
A2
0
A3
0
A4
0
A5
0
A6
0
A7
0
B0
2
Delete
0
B1
0
B2
0
B3
0
B4
0
B5
0
B6
0
B7
0
SUB
S7
3
Delete
V
8b
DEC
A
8b
DEC
B
8b
DEC
M
© 2026 Daniil Khanin · khanin.info · HB-02
40
CANVAS …
4
Delete
ADDSUB8
A0
A0
A1
A1
A2
A2
A3
A3
A4
A4
A5
A5
A6
A6
A7
A7
B0
B0
B1
B1
B2
B2
B3
B3
B4
B4
B5
B5
B6
B6
B7
B7
SUB
SUB
S0
S0
S1
S1
S2
S2
S3
S3
S4
S4
S5
S5
S6
S6
S7
S7
CO
C
V
V
5
Delete
ADDSUB8
A0
GND
A1
GND
A2
GND
A3
GND
A4
GND
A5
GND
A6
GND
A7
GND
B0
S0
B1
S1
B2
S2
B3
S3
B4
S4
B5
S5
B6
S6
B7
S7
SUB
S7
S0
M0
S1
M1
S2
M2
S3
M3
S4
M4
S5
M5
S6
M6
S7
M7
CO
V
© 2026 Daniil Khanin · khanin.info · HB-02
41
BCD1
6
IN
9×
OUT
5×
A0
A1
A2
A3
B0
B1
B2
B3
CI
D0
D1
D2
D3
CO
7
ADDER4
1×
2
14×
ADDER4
A0
A0
A1
A1
A2
A2
A3
A3
B0
B0
B1
B1
B2
B2
B3
B3
CI
CI
S0
s0
S1
s1
S2
s2
S3
s3
CO
c
8
OR
2×
1
AND
1×
1
9×
OR
I0
s1
I1
s2
O0
s12
AND
I0
s3
I1
s12
O0
big
OR
I0
c
I1
big
O0
CO
9
ADDER4
1×
2
13×
ADDER4
A0
s0
A1
s1
A2
s2
A3
s3
B0
GND
B1
CO
B2
CO
B3
GND
CI
GND
S0
D0
S1
D1
S2
D2
S3
D3
CO
© 2026 Daniil Khanin · khanin.info · HB-02
42
BCD1 …
CANVAS
10
Ctrl
+
G
Library
…
Chip N
2×
Library
…
BCD1
Enter
BCD1
A0
A1
A2
A3
B0
B1
B2
B3
CI
D0
D1
D2
D3
CO
11
0
5×
5×
0
A0
0
A1
0
A2
0
A3
0
A4
12
0
5×
5×
0
A5
0
A6
0
A7
0
B0
0
B1
© 2026 Daniil Khanin · khanin.info · HB-02
43
CANVAS …
13
0
5×
5×
0
B2
0
B3
0
B4
0
B5
0
B6
14
0
1×
1×
0
B7
15
BCD1
1×
14×
BCD1
A0
A0
A1
A1
A2
A2
A3
A3
B0
B0
B1
B1
B2
B2
B3
B3
CI
GND
D0
D0
D1
D1
D2
D2
D3
D3
CO
c10
© 2026 Daniil Khanin · khanin.info · HB-02
44
CANVAS …
16
BCD1
1×
14×
BCD1
A0
A4
A1
A5
A2
A6
A3
A7
B0
B4
B1
B5
B2
B6
B3
B7
CI
c10
D0
D4
D1
D5
D2
D6
D3
D7
CO
H
17
1×
1×
H
18
4b
0
A
3×
8b
HEX
A
8b
HEX
B
8b
HEX
D
A
0
A7
0
A6
1
A5
0
A4
0
A3
0
A2
1
A1
1
A0
B
0
B7
1
B6
0
B5
0
B4
0
B3
1
B2
0
B1
1
B0
68
D
100
A
0
A7
0
A6
1
A5
1
A4
1
A3
0
A2
0
A1
0
A0
B
0
B7
1
B6
0
B5
0
B4
0
B3
1
B2
1
B1
1
B0
85
D
100
A
1
A7
0
A6
0
A5
1
A4
1
A3
0
A2
0
A1
1
A0
B
0
B7
0
B6
0
B5
0
B4
0
B3
0
B2
0
B1
1
B0
00
D
100
© 2026 Daniil Khanin · khanin.info · HB-02
45
← Back to the lesson
Lesson 6 (bonus). Decimal math: add six