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 8 in pictures
← Back to the lesson: Lesson 8. The card — into a chip with 8 legs
8
The card as a chip
8 legs, a second card, the tester as a chip too
kh
HT-01
0000 0001
0000 0001
CARD
CARD
C1
VCC
C2
RST
C3
CLK
C4
C5
GND
C6
FAC
C7
IO
C8
IN
17×
OUT
12×
CARD2
1×
∞
Ctrl
+
G
CARD
TERM
© 2026 Daniil Khanin · khanin.info · HT-01
96
CANVAS
1
outside: Clock, RST, FAC, the tester, Power, Ground
2
IN
5×
C1 ← VCC
C2 ← RST
C3 ← CLK
C4 ← nc4
C5 ← GND
3
IN
1×
OUT
2×
C6 ← FAC
C7 ← IO
C8 ← nc8
4
Ctrl
+
G
Library
…
Chip N
2×
Library
…
CARD
Enter
CARD
C1
C2
C3
C4
C5
C6
C7
C8
5
CARD
1×
6×
CARD
C1
VCC
C2
RST
C3
CLK
C4
C5
GND
C6
FAC
C7
IO
C8
© 2026 Daniil Khanin · khanin.info · HT-01
97
CANVAS …
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 → 1
… P 12 34 → 144 · A A5 3C → 104
0
T7
1
T6
0
T5
1
T4
0
T3
0
T2
1
T1
0
T0
0101 0010 $52
SEND
SEND
lamp
247
R → $F7
6
Library
…
CARD
⧉
Library
…
CARD
CARD2
Enter
copy of the chip
© 2026 Daniil Khanin · khanin.info · HT-01
98
CANVAS …
7
Edit → matrix pr0–pr6 × pb7–pb0
pb7
pb6
pb5
pb4
pb3
pb2
pb1
pb0
pr0
01 → 02
pr1
12 → 43
pr2
34 → 21
pr3
5A → 21
pr4
C3 → 9F
pr5
17 → E4
pr6
8E → 3B
there, keep
remove
add: nmos(pr, pb, GND)
empty
remove 14 · add 15 · keep 8
8
CARD
C1
VCC
C2
RST
C3
CLK
C4
C5
GND
C6
FAC
C7
IO
C8
CARD2
C1
VCC
C2
RST
C3
CLK
C4
C5
GND
C6
FAC
C7
IO
C8
take out CARD — insert CARD2: the same 6 labels on the same legs
9
CARD2
1×
6×
CARD2
C1
VCC
C2
RST
C3
CLK
C4
C5
GND
C6
FAC
C7
IO
C8
© 2026 Daniil Khanin · khanin.info · HT-01
99
CANVAS …
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
2
N → 2
… P 43 21 → 144 · A A5 3C → 234 ($EA)
0
T7
1
T6
0
T5
1
T4
0
T3
0
T2
1
T1
0
T0
0101 0010 $52
SEND
SEND
lamp
221
R → $DD
10
switches, SEND, lamps and display stay outside
11
IN
11×
OUT
10×
CLK
RST
SEND
T0
T1
T2
T3
T4
T5
T6
T7
sr0
sr1
sr2
sr3
sr4
sr5
sr6
sr7
lamp
IO
© 2026 Daniil Khanin · khanin.info · HT-01
100
CANVAS …
12
Ctrl
+
G
Library
…
Chip N
2×
Library
…
TERM
Enter
TERM
CLK
RST
SEND
T0
T1
T2
T3
T4
T5
T6
T7
sr0
sr1
sr2
sr3
sr4
sr5
sr6
sr7
lamp
IO
13
TERM
1×
21×
TERM
CLK
CLK
RST
RST
SEND
SEND
T0
T0
T1
T1
T2
T2
T3
T3
T4
T4
T5
T5
T6
T6
T7
T7
sr0
sr0
sr1
sr1
sr2
sr2
sr3
sr3
sr4
sr4
sr5
sr5
sr6
sr6
sr7
sr7
lamp
lamp
IO
IO
© 2026 Daniil Khanin · khanin.info · HT-01
101
← Back to the lesson
Lesson 8. The card — into a chip with 8 legs