Skip to content

Course: Arithmetic circuits -- adders, multipliers, CORDIC, floating point (9x3, hardware track) #1488

Open

Description

@gHashTag

Parent epic: #1476

Course id: arithmetic-circuits
Audience: hardware engineers (RTL / FPGA / ASIC).
Prerequisites: Course 1 module numbers; Course goldenfloat recommended.

Why this course

Arithmetic circuit design is a classic university course and a core interview topic. The repo has ternary adders, hybrid arithmetic, bigint, and correctly rounded GoldenFloat add/multiply (gft_add_rne, gft_mul_rne), but no course on how adders and multipliers are built and what they cost on a 7-series chip.

What already exists in the repo (grounding)

  • ternary/ternary_full_adder.t27, ternary_ripple_adder.t27, hybrid_arithmetic.t27, bigint.t27, hybrid_bigint.t27
  • ternary/gft_add_rne.t27, gft_mul_rne.t27, gft_recip.t27, gft_madd.t27
  • fpga/mac.t27
  • Missing: binary adder families, multipliers, CORDIC, divider specs

Decomposition: 9 modules x 3 lessons

Module 1 -- adders: adding fast

# Lesson id What the reader learns Spec Widget idea
1 ripple-carry ripple carry and its delay ternary/ternary_ripple_adder.t27 + NEW arith/adders.t27 delay vs width
2 lookahead carry lookahead, generate/propagate NEW arith/adders.t27 G/P tree
3 prefix-adders Kogge-Stone, Brent-Kung, Sklansky NEW arith/adders.t27 prefix network drawer

Module 2 -- carry-chains: what the FPGA gives you

# Lesson id What the reader learns Spec Widget idea
4 carry4 the CARRY4 primitive on 7-series NEW arith/adders.t27 CARRY4 annotator
5 why-ripple-wins-on-fpga why fancy adders lose to the carry chain NEW arith/adders.t27 LUT/delay from yosys + nextpnr
6 carry-save carry-save addition for many operands NEW arith/adders.t27 CSA tree

Module 3 -- multipliers: multiplying

# Lesson id What the reader learns Spec Widget idea
7 array-multiplier partial products and the array NEW arith/multipliers.t27 partial-product grid
8 booth radix-4 Booth recoding NEW arith/multipliers.t27 Booth recoder
9 wallace-dadda Wallace and Dadda trees NEW arith/multipliers.t27 tree compressor

Module 4 -- dsp-blocks: hard multipliers

# Lesson id What the reader learns Spec Widget idea
10 dsp48e1 DSP48E1: pre-adder, multiplier, ALU fpga/mac.t27 DSP48 configurator
11 cascades cascading DSPs for wide products fpga/mac.t27 cascade diagram
12 lut-vs-dsp when LUT multipliers win (ternary, small widths) ternary/hybrid_arithmetic.t27 cost curves

Module 5 -- division: dividing and roots

# Lesson id What the reader learns Spec Widget idea
13 restoring restoring and non-restoring division NEW arith/divider.t27 division stepper
14 srt SRT division and quotient digit selection NEW arith/divider.t27 QDS table
15 newton Newton-Raphson reciprocal ternary/gft_recip.t27 convergence plot

Module 6 -- cordic: rotations with shifts and adds

# Lesson id What the reader learns Spec Widget idea
16 cordic-rotation rotation mode: sin and cos NEW arith/cordic.t27 CORDIC rotation animation
17 cordic-vectoring vectoring mode: atan and magnitude NEW arith/cordic.t27 vectoring stepper
18 cordic-precision iterations vs bits of precision NEW arith/cordic.t27 error vs iterations

Module 7 -- fp-add: floating-point addition

# Lesson id What the reader learns Spec Widget idea
19 align-add-normalize exponent compare, align, add, normalize ternary/gft_add_rne.t27 FP adder stepper
20 round-to-nearest-even guard, round, sticky; RNE ternary/gft_add_rne.t27 GRS bit explorer
21 special-values zero, inf, NaN, subnormals in hardware ternary/gft_add_rne.t27 special-case table

Module 8 -- fp-mul: floating-point multiply and fused ops

# Lesson id What the reader learns Spec Widget idea
22 fp-multiply significand product and exponent add ternary/gft_mul_rne.t27 FP multiplier stepper
23 fma fused multiply-add: one rounding ternary/gft_madd.t27 FMA vs mul+add error
24 fp-cost LUT/DSP cost per format width ternary/gft_mul_rne.t27 cost per GoldenFloat width from yosys

Module 9 -- big-numbers: beyond the word

# Lesson id What the reader learns Spec Widget idea
25 bigint multi-word arithmetic ternary/bigint.t27 limb visualizer
26 hybrid-bigint binary/ternary big integers ternary/hybrid_bigint.t27 cost comparison
27 capstone a correctly rounded GF16 FMA on the board ternary/gft_madd.t27 build receipt + vectors

Specs that do not exist yet (write in gHashTag/t27 first)

  • arith/adders.t27 -- ripple, lookahead, prefix, carry-save, CARRY4 model
  • arith/multipliers.t27 -- array, Booth, Wallace/Dadda
  • arith/divider.t27 -- restoring, non-restoring, SRT
  • arith/cordic.t27 -- rotation and vectoring

Honesty notes and traps

  • Every cost figure must come from a yosys/nextpnr run on a named part, not a textbook.
  • FP lessons reuse GoldenFloat specs; cross-link the goldenfloat course instead of re-teaching the formats.

Acceptance criteria

  • specs/course/<id>.t27 + <id>-ru.t27 exist, registered in specs/course/courses.t27, built by course-from-spec.mjs (recipe: specs/course_recipe/course-27.t27).
  • Exactly 9 modules x 3 lessons = 27 lessons; every lesson names one widget and one spec.
  • Every lesson spec compiles AND its test blocks pass in the reader's browser (blocked by the browser-runner issue), or the lesson says plainly that it is a recorded tri cast and links the recording.
  • Every number on a page comes from real tool output named in the widget's DATA_SOURCES (yosys / nextpnr / board run / spec test). No invented figures.
  • Board named on every hardware page (Wukong xc7a200tfgg676 vs AX7203 xc7a200tfbg484 vs Arty A7 / XC7A100T).
  • Black-and-white share cards and SEO pages generated for all 27 lessons (EN + RU).
  • The course PR carries a blog post: EN body + RU ruBody.
  • Lessons that need a spec that does not exist yet are listed as sub-tasks (spec first in gHashTag/t27, then copied here).

Blocked by: #1477 (browser test runner) for every lesson whose spec uses calls, locals or struct fields in tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions