dev.hardware
wire gauges, drill bits, RAID capacity and memory timings
Quick calculations for building and sizing hardware: how thick a wire or drill bit is, which bit to drill for a screw thread, how much space a RAID array leaves you, and how long memory takes to answer.
Tags: binary
awgthe diameter of American Wire Gauge number gauge, in mmdrill_bitthe diameter of a drill bit written as a number like “#7”, a letter like “F” or a fraction of an inch like “1/4”, in mmtap_drillthe drill bit to use before cutting a metric thread like “M6”, as a diameter in mmraidthe usable capacity of n disks of size disk in a RAID array of the given levelram_latencythe true latency of memory in ns, from its transfer rate in MT/s and CAS latency cl
Functions
Section titled “Functions”awg(gauge: int) -> quantity
the diameter of American Wire Gauge number gauge, in mm
Gauges 0 to 40 are accepted, a larger number is a thinner wire
1awg(12)2.05253 mm2awg(24) to in0.0201008 inSee also raid
drill_bit
Section titled “drill_bit”drill_bit(size: str) -> quantity
the diameter of a drill bit written as a number like “#7”, a letter like “F” or a fraction of an inch like “1/4”, in mm
Numbers run from #1 to #80, a larger number is a smaller bit, and letters from A to Z are bigger than #1
1drill_bit("#7")5.1054 mm2drill_bit("F")6.5278 mm3drill_bit("1/4") to in0.25 intap_drill
Section titled “tap_drill”tap_drill(thread: str) -> quantity
the drill bit to use before cutting a metric thread like “M6”, as a diameter in mm
It is the thread’s size minus its pitch, for the standard coarse pitch, or “M8x1” for a fine one. Sizes M2 to M24 are known
1tap_drill("M6")5 mm2tap_drill("M8x1")7 mmSee also drill_bit
raid(level: int, disk: quantity, n: int) -> quantity
the usable capacity of n disks of size disk in a RAID array of the given level
Levels 0, 1, 5, 6 and 10 are supported. RAID 1 mirrors every disk, and RAID 10 mirrors pairs, so it needs an even number of disks
1raid(5, 4 TB, 4)12 TB2raid(10, 2 TB, 6)6 TBSee also awg
ram_latency
Section titled “ram_latency”ram_latency(rate: num, cl: num) -> quantity
the true latency of memory in ns, from its transfer rate in MT/s and CAS latency cl
Memory does two transfers per clock, so the clock is half the rate
1ram_latency(6000, 30)10 ns2ram_latency(3200, 16)10 nsMore examples
Section titled “More examples”hardware
Section titled “hardware”1# how thick is 12 gauge wire?2awg(12)2.05253 mm3# the size of a number, letter or fraction drill bit4drill_bit("#7")5.1054 mm5# which bit to drill before tapping an M6 thread6tap_drill("M6")5 mm7# usable space of 4 disks in RAID 58raid(5, 4 TB, 4)12 TB9# how long DDR5-6000 CL30 takes to answer10ram_latency(6000, 30)10 nsExample results generated on 2026-11-04. Ones using now, today or randomness will differ when you run them.