Kits
›
The Payment Card
RU
EN
ES
Contents
Introduction
History: from cardboard to a computer
Lesson 0. Gates from transistors: for those who start from scratch
0.1. The idea: a transistor is a switch
0.2. Building
0.3. Check
Lesson 0 paste (Cmd+I)
Lesson 1. The ALU and register A: a calculator on switches
1.1. The idea: one action per clock
1.2. The idea: one adder for four operations
1.3. The idea: flags are the memory of the result
1.4. Building
1.5. Checking
Lesson 1 paste (Cmd+I)
Lesson 2. The program counter and ROM: lights by the program
2.1. The idea: a program is a list of commands
2.2. The idea: jumps and a subroutine
2.3. Building
2.4. Checking
Lesson 2 paste (Cmd+I)
Lesson 3. RAM from latches: a light through memory
3.1. The idea: the address is in the command
3.2. The idea: a latch writes while it is open
3.3. The idea: memory at power-on is garbage
3.4. Building
3.5. Checking
Lesson 3 paste (Cmd+I)
Lesson 4. Loops and conditions: multiplication by repeated addition
4.1. The idea: a counter down to zero
4.2. The program
4.3. Checking
Lesson 5. The IO wire and the card tester: echo
5.1. The idea: one wire for two
5.2. The idea: a byte bit by bit
5.3. The idea: the "exchange — wait" lamp
5.4. Building
5.5. Checking
Lesson 5 paste (Cmd+I)
Lesson 6. Personal data and the try counter: the card checks the PIN
6.1. The idea: the identity is in transistors
6.2. The idea: tries that are not erased
6.3. Building
6.4. Checking
Lesson 6 paste (Cmd+I)
Lesson 7. The card program: challenge-response
7.1. The idea: a secret that never leaves
7.2. The idea: a long answer in two commands
7.3. The program
7.4. Checking
Lesson 8. The card — into a chip with 8 legs
8.1. The idea: a card is what is inside
8.2. The idea: two cards — one program
8.3. Building
8.4. Checking
Lesson 8 paste (Cmd+I)
Summary
All the parts
Instructions in pictures
Lesson 6 in pictures
← Back to the lesson: Lesson 6. Personal data and the try counter: the card checks the PIN
6
Personal data and PIN
number, PIN and key — in transistors
kh
HT-01
pb7
pb6
pb5
pb4
pb3
pb2
pb1
pb0
pr0
01
pr1
12
pr2
34
pr3
5A
pr4
C3
pr5
17
pr6
8E
account 01
PIN 12 34
key 5A C3 17 8E
0
1×
NOT
1×
0
AND
1×
0
RBIT
2×
1
N
22×
∞
© 2026 Daniil Khanin · khanin.info · HT-01
89
CANVAS
1
0
1×
NOT
1×
0
AND
1×
0
6×
0
FAC
NOT
I0
FAC
O0
nFAC
AND
I0
oST
I1
selTRY
O0
wTRY
2
RBIT
2×
1
10×
RBIT
D
acc0
LD
wTRY
nR
nFAC
CLK
CLK
Q
try0
RBIT
D
acc1
LD
wTRY
nR
nFAC
CLK
CLK
Q
try1
3
N
3×
9×
pb0
GND
G
N
pr0
pb1
GND
G
N
pr1
pb4
GND
G
N
pr1
© 2026 Daniil Khanin · khanin.info · HT-01
90
CANVAS …
4
N
3×
9×
pb2
GND
G
N
pr2
pb4
GND
G
N
pr2
pb5
GND
G
N
pr2
5
N
3×
9×
pb1
GND
G
N
pr3
pb3
GND
G
N
pr3
pb4
GND
G
N
pr3
6
N
3×
9×
pb6
GND
G
N
pr3
pb0
GND
G
N
pr4
pb1
GND
G
N
pr4
© 2026 Daniil Khanin · khanin.info · HT-01
91
CANVAS …
7
N
3×
9×
pb6
GND
G
N
pr4
pb7
GND
G
N
pr4
pb0
GND
G
N
pr5
8
N
3×
9×
pb1
GND
G
N
pr5
pb2
GND
G
N
pr5
pb4
GND
G
N
pr5
9
N
3×
9×
pb1
GND
G
N
pr6
pb2
GND
G
N
pr6
pb3
GND
G
N
pr6
10
N
1×
3×
pb7
GND
G
N
pr6
© 2026 Daniil Khanin · khanin.info · HT-01
92
CANVAS …
11
ROM
256 × 16
Memory
⬆
⬇
0801 0802 0804
0808 0810 0820
0840 0880 E011
06-pin.rom.json
1
RST
1
FAC
1 → 0
59
$3B
0
T7
1
T6
0
T5
0
T4
1
T3
1
T2
1
T1
0
T0
0100 1110 $4E
SEND
SEND
lamp
1
N
0
T7
1
T6
0
T5
1
T4
0
T3
0
T2
0
T1
0
T0
0101 0000 $50
SEND
SEND
lamp
—
P
0
T7
0
T6
0
T5
1
T4
0
T3
0
T2
1
T1
0
T0
0001 0010 $12
SEND
SEND
lamp
—
12
0
T7
0
T6
1
T5
1
T4
0
T3
1
T2
0
T1
0
T0
0011 0100 $34
SEND
SEND
lamp
144
34 → $90
© 2026 Daniil Khanin · khanin.info · HT-01
93
← Back to the lesson
Lesson 6. Personal data and the try counter: the card checks the PIN