Introduction

In "The Payment Card" you built the computer of a card and checked it with the switches and lamps of the tester. Now — the machine on the other side of the slot: an ATM. It asks for the PIN, checks that the card is genuine, shows the account and the balance and gives out money. And all of it is the same processor as in the card, only with a different program and different devices around it.

Inside:

  • the card processor — we do not build it again, we copy it from our card and fold it into the CPU chip;
  • a keypad — 12 keys, an encoder into 4 wires, one press — one clock cycle;
  • a screen — a segment LCD: 8 words, an entry field, the account and the balance;
  • a bank — the keys of both cards in a transistor matrix and two accounts that reset does not erase;
  • a card port — the tester from "The Payment Card", now its buttons are pressed by the program; a slot for two cards;
  • a random challenge — 8 flip-flops in a ring;
  • a program — 250 commands: the PIN, challenge-response, the amount, the payout.

What you need

This kit is the sequel to "The Payment Card" and does not work without it: the canvas must hold the assembled CARD, CARD 2 and the TERM tester. All the gates and card chips (RBIT, MUX2, OR8, DEC8…) are already in the library. From "A Watch and a Game" you need NAND3 and DEC4x1 — if they are not there, the paste of lesson 3 adds them itself.

How big it is

The ATM is 15,062 transistors, of them 6,132 are the processor, the same as in the card, and 1,729 are the tester that became the port. The rest is the keypad, the screen, the bank and the slot. Every card is about 6,500.

This is a model, not a real ATM

We build the principle: who checks what and who knows what. How our ATM differs from a real one:

WhatA real ATMOur ATM
where the bank isfar away: the ATM calls it over a
network
inside the ATM: two registers
card keysin the bank's safe (HSM), not in the ATMin a transistor matrix of the ATM
PINencrypted in the keypad, checked by the
card or the bank
checked by the card
moneybanknote cassettes, a counter, a shuttera number on the screen
accountsmillionstwo, 0–255 each
processoran ordinary computer with Windows/Linuxthe card processor, 256 commands

The main thing is as in a real one: the ATM knows neither the PIN nor the card key, and the money lies in the bank, not on the card.

What you will get

Eight lessons: the processor → the keypad → the screen → the bank → the port and the slot → the PIN and challenge-response → withdrawing money → a fake and the ATM as a chip. At the end the table holds an ATM with a screen and a keypad and three cards. Two real ones give out money, and the fake one — with the right number and PIN — gets DECLINED.