Karim Mohamed

Index

  1. 01Homestart here
  2. 02Researchrun the testbenches
  3. 03Workshopthings to poke
  4. 04Venturescompanies
  5. 05Experiencethe files
  6. 06About meand what’s on now
  7. 07Off the clockplay a game

More

Seattle · ·

GitHubLinkedInContact
03 Workshop

The workshop.

These are things I’m learning and building, set out so you can play with them. You don’t need to be an engineer: every exhibit says what it is and why I think it’s interesting. Most of them connect to one of my research projects.

everything here actually works — go ahead and click

01

Binary, by hand

Computers only have on and off. Here’s how that becomes every number. Flip bits and watch the value change.

what you’re looking atEight switches that make one number: tap a bit to flip it and watch the decimal value change.

Decimal42

Hex0x2A

Binary0010 1010

Signed42 as an 8-bit two’s-complement byte

Place values: click a bit to flip it

Sum65 = 0b100 0001

02

Gates, then arithmetic

Seven logic gates, then how a few of them add two bits, then how four adders add four-bit numbers. This is the bottom of every processor.

what you’re looking atLogic gates wired into adders: tap the inputs and follow the 1s and 0s through the circuit.

Seven gates

Tap an input to toggle it. The current row of each truth table is highlighted.

AND

Y = A · B
0
Truth table for AND
ABY
000
010
100
111

High only when both inputs are high.

OR

Y = A + B
1
Truth table for OR
ABY
000
011
101
111

High when at least one input is high.

XOR

Y = A ⊕ B
1
Truth table for XOR
ABY
000
011
101
110

High when the inputs differ: one-bit addition without the carry.

NOT

Y = Ā
1
Truth table for NOT
AY
01
10

Inverts a single input.

NAND

Y = ¬(A · B)
1
Truth table for NAND
ABY
001
011
101
110

Universal: every other gate can be built from NANDs alone.

NOR

Y = ¬(A + B)
0
Truth table for NOR
ABY
001
010
100
110

Also universal. The Apollo Guidance Computer was built from NOR gates.

XNOR

Y = ¬(A ⊕ B)
0
Truth table for XNOR
ABY
001
010
100
111

High when the inputs are equal: a one-bit comparator.

From gates to arithmetic

Half adder

Adds two bits. XOR gives the sum bit; AND gives the carry.

A
B
S = A ⊕ B
0
C = A · B
1

1 + 1 = 102 = 2

Full adder

Two half adders and an OR. This exact structure, chained eight times, is RISC8’s adder.

A
B
Cin
x = A ⊕ B
0
g = A · B
1
S = x ⊕ Cin
0
p = x · Cin
0
Cout = g + p
1

1 + 1 + 0 = 102 = 2

✓ matches RISC8’s fullAdder()

A 4-bit ripple-carry adder

A= 7
B= 1
  1. FA30 + 0 + c3S3 = 1c4 = 0
  2. FA21 + 0 + c2S2 = 0c3 = 1
  3. FA11 + 0 + c1S1 = 0c2 = 1
  4. FA01 + 1 + c0S0 = 0c1 = 1

Σ = 010002 = 8

Try A = 1111, B = 0001: the carry has to travel through every stage before the answer is valid. That worst-case path is why fast adders use carry-lookahead instead.

03

A small logic puzzle

Flip three switches until the lamp lights. The third puzzle is secretly the carry-out of a full adder.

what you’re looking atA lamp wired to a hidden logic rule: flip the three switches until it lights.

Puzzle 1 of 4 · Warm-up

lamp = ((A AND B) AND C)

ABC

1 of 8 combinations light it.
04

An ALU you can poke

The arithmetic unit from my RISC8 processor, running its real gate-level code. The full processor →

what you’re looking atThe arithmetic unit from my processor: pick an operation, flip bits in A and B, and read the result and flags.

A
0x96
B
0x35
ADD result11001011= 203 · 0xCBZ=0N=1C=0
FA71c8=0FA61c7=0FA50c6=1FA40c5=1FA31c4=0FA20c3=1FA11c2=0FA01c1=0

Eight full adders in a row. Click bits to watch the carries change.

05

A processor playground

Write assembly, step the clock, watch the datapath light up. It lives with the research it belongs to.

LDI R1, 13
LDI R2, 11
loop: AND R4, R2, R5
  BZ R4, skip
  ADD R3, R3, R1 …
Open the RISC8 simulator multiply 13 × 11 without a multiply instruction
06

A robot arm (on paper)

Three joints, a camera and a force sensor: a software sketch of my robotics research. The research →

what you’re looking atA simulated three-joint arm: drag the object, then tap Grasp and Lift to see if the grip holds.

Side view of a three-joint robot arm, a table and a wooden blockJoints J1 100°, J2 -110°, J3 -60°. Gripper centre at 16.3, 16.3 cm pointing -70°. The wooden block is on the table at 30.0 cm; the camera estimates 29.5, 0.9 cm.
Conceptual demo — not connected to hardware or real data
Test conditions
30 seconds · simulated physics
Predicted P(failure)100%
  • gripper is 20.3 cm from where the camera thinks the wooden block is
  • planned grip 4.0 N is below the ~7.5 N needed to hold it
  • perception error is large: ±1.2 cm (1σ along the camera ray)

Ready. Drag the object along the table, then try Reach, Grasp and Lift.

An illustration of the research idea, not its method or results. Drag the object, then Grasp and Lift.

07

Why fast things look slow

Sample a wave too slowly and it lies to you. The same reason wheels look like they spin backwards on video, and the reason my phased-array project samples carefully.

what you’re looking atA fast wave sampled too slowly: drag the sample rate down and watch a fake, slower wave appear.

Sampling at more than twice the signal frequency (Nyquist), so the dots trace the real 3 Hz wave.

08

Circles that draw anything

The same maths that splits a sound into frequencies can redraw any shape with spinning circles. It’s the idea under the FFT in my phased-array project.

what you’re looking atSpinning circles stacked tip to tail can draw any closed shape: add harmonics to build a square wave and watch the 9% overshoot that never goes away, or draw a loop and watch the circles learn to redraw it.

f(x) ≈ 4/π · (sin x + sin 3x/3 + sin 5x/5 + ⋯ + sin 13x/13)

Square wave from 7 odd harmonics (up to 13×); overshoot ≈ 9.0% at every edge.

09

The workbench: ideas that didn’t survive

Finished projects hide the wrong turns and the tempting shortcuts. Here are three ideas I set aside, what showed me they wouldn’t work, and what replaced them. Each is documented elsewhere on this site.

  1. idea 01 · retired

    “Vision alone will make the arm reliable.”

    My first research question (October 2026) asked how computer vision could make a robot arm more accurate. One of the readings showed that a robot doesn’t always know exactly where its own arm is, and a camera can’t tell you how hard the gripper is squeezing. A grasp can look right and still fail.

    instead → Add a force sensor, and ask the arm to predict, and learn from, its own failed grasps.

    how the question changed →
  2. idea 02 · retired

    “Start with a pipelined processor.”

    A pipeline is faster, but hazards and forwarding make every bug harder to see, and there was no way yet to prove even the simple version was right.

    instead → A multi-cycle core, four readable clock states per instruction, checked byte-for-byte against a golden trace. Pipelining comes next, against those same traces.

    the decision →
  3. idea 03 · retired

    “To make a faint test line easier to see, make it darker.”

    It sounds obvious. The contrast model says otherwise: colour that lands on the whole strip, not just the line, darkens the background too, so the line can get darker while the test gets worse.

    instead → Judge every enhancement by contrast between line and background, and test that cheaply with food dye on paper before any chemistry.

    try the model →
10

Other things on the bench

Smaller projects, each a study of one layer of the stack. All open source.

Esc
  • Homestart here
  • Researchrun the testbenches
  • Workshopthings to poke
  • Venturescompanies
  • Experiencethe files
  • About meand what’s on now
  • Off the clockplay a game
  • My deskclick the objects
  • Field notesdated entries
  • Nowthis season
  • Changeloghow it grew
  • Photographycamera roll
  • Failure-aware manipulation
  • MalaBoost
  • RISC8 processor
  • Writing
  • Contact
  • Terminal
  • Colophon
  • Failure-aware robotic manipulationRobotics · In development
  • MalaBoostDiagnostics · Proposed design, Simulation
  • RISC8, a processor from the gates upComputer architecture · Simulation
  • Catalytic enhancement for faint pLDH linesResearch design · not peer reviewed
  • RISC8 architecture specificationTechnical specification
  • RushdFounder & CEO
  • Preventa HomeCo-founder
  • DaythreadBuilt the product on a hackathon team
  • Run the RISC8 processorguided tours
  • Make the robot arm sliptestbench
  • Rescue a faint malaria test lineMalaBoost model
  • Logic gates, adders & a puzzle
  • Watch the worst-case carry
  • Take a penaltythe keeper learns
  • ? Some pages have a key just under Esc.not yet
  • ? Two keys, one of them is K.not yet
  • ? The terminal can run a diagnostic.not yet
  • ? Referees are allowed a second look. So is the terminal.not yet
  • ? Every card is hiding a constraint.not yet
  • ? The footer is saying something.not yet
  • ? Seven cards on About. All of them.not yet

40 results

terminal · ` or Esc to close