Lesson 2. The rope

Now we can see the buffer. What is left is to control it: release a part only when Herbie is running short of work. In «The Goal», on the hike, Alex put Herbie at the head of the column so that nobody ran ahead. But you cannot move a machine to the start of the line. So later, in the book «The Race» (1986), Goldratt proposed a rope: the leader of the column is tied to Herbie and cannot get further ahead than the rope allows. Our rope is a wire from the buffer counter to the source.


2.1. Idea: release while the buffer is below the goal

The panel gets four switches — the buffer goal in binary: G3 = 8, G2 = 4, G1 = 2, G0 = 1. Switch on G2 — the goal is 4. The rule of the rope:

  • the buffer is below the goal — the source releases a part as before;
  • the buffer has reached the goal — the source waits, release ticks are skipped.

So there are never more parts before Herbie than the goal.

RELSbuffer343434343434LOWRELRgoal 4: the buffer reached 4 — release ticks are skipped until Herbie takes a part
The rope over time: RELS ticks every second, but only the ticks when the buffer is below the goal reach the source.

2.2. Idea: comparing — the CD4585

The CD4585 compares two four-bit numbers A and B and lights one of three outputs: LT (A < B), EQ (A = B) or GT (A > B). Our buffer has eight bits and the goal four, so there are two comparators in a cascade:

  • the low one compares the low halves: A0…A3 = Q0…Q3, B0…B3 = G0…G3; cascade inputs EQIN = 1, LTIN = 0, GTIN = 0 — «so far the numbers are equal»;
  • the high one compares the high halves: A0…A3 = Q4…Q7, B0…B3 = 0000 — the goal has no high bits; its cascade inputs are the low one's outputs. If the high halves are equal, the high one passes on the low one's answer;
  • the high one's LT output is the label LOW: «the buffer is below the goal».
CD4585low 4 bitsCD4585high 4 bitsA0…A3 = Q0…Q3B0…B3 = G0…G3EQIN = 1 · LTIN = 0 · GTIN = 0A0…A3 = Q4…Q7B0…B3 = 0000LT · EQ · GTLOWLOW = 1 when the buffer Q is less than the goal G
A cascaded comparison: the low CD4585 compares the low halves, the high one the high halves (the goal has zeros there) and, if equal, passes on the low one’s answer.

2.3. Formula

ROPELOWROK — may release
0—1 — the rope is off
111 — buffer below the goal
100 — buffer full, wait
  • NROPE = NOT ROPE — a free inverter of the FL-01 CD4069 (input C, output I);
  • ROK = LOW OR NROPE — a free gate of the FL-02 CD4071 (E, F → L);
  • RELR = RELS AND ROK — a free gate of the second FL-02 CD4081 (C, D → K);
  • the source listens to RELR instead of RELS.
ROPECD4069NROPELOWCD4071ROKRELSCD4081RELRsourceRELEASERELR = RELS · (LOW + NOT ROPE)
The rope from three free gates of FL-01 and FL-02: with the rope on, a release tick gets through only while the buffer is below the goal.

With the ROPE switch off everything works as in FL-02, including SLOW: a release every second or at Herbie's rhythm.

2.4. Assembly

Insert the lesson with Cmd+I on top of lesson 1. You get:

  • on the base, in the top row — the ROPE switch and four goal switches captioned 8, 4, 2, 1;
  • outside — two CD4585;
  • the free gates of FL-01 and FL-02 get labels: CD4069 (C → ROPE, I → NROPE), CD4071 (E → LOW, F → NROPE, L → ROK), the second CD4081 (C → RELS, D → ROK, K → RELR);
  • the source's RELEASE leg is reconnected from RELS to RELR.

2.5. Check

Herbie — 2 seconds, SLOW off. Each shift: power off and on → R → START, watch for 200 seconds.

ShiftBufferMade by 200 s
ROPE offgrows to 18about 94
ROPE on, goal 4 (G2)at most 4about 94
ROPE on, goal 1 (G0)0 or 1about 24

With goal 4 the factory makes as much as without the rope, but holds three times fewer parts inside.

With goal 1 Herbie stands almost all the time — the FL-02 idle meter with the probe on machine 3 (after R press S twice) shows about 150 seconds out of 200. Why: the buffer counts all the parts from the source to Herbie, and the only part still has to travel through machines 1 and 2. While it is on its way, Herbie has nothing to do. The goal must cover the way to Herbie. How much stock is needed when Herbie works unevenly — in the next lesson.

Lesson 2 insert (Cmd+I)

# Lesson 2 — the rope. Insert on top of lesson 1.# Goal G = four switches (G3 = 8, G2 = 4, G1 = 2, G0 = 1). Two CD4585 compare the buffer Q (8 bits) with G (4 bits, high nibble = 0):# LOW = Q < G. The source may release only while LOW: RELR = RELS · (LOW + NOT ROPE). ROPE off — FL-02 works as before.# NROPE: a free inverter of the FL-01 CD4069 (C → I). ROK = LOW OR NROPE: a free gate of the FL-02 CD4071 (E, F → L).# RELR = RELS AND ROK: a free gate of the second FL-02 CD4081 (C, D → K). The source's RELEASE: RELS → RELR.text tR{text="rope"}at(tR, B, 40, 8)input rope(ROPE)at(rope, B, 40, 20)text t8{text="8"}at(t8, B, 130, 8)input g3(G3)at(g3, B, 130, 20)text t4{text="4"}at(t4, B, 190, 8)input g2(G2)at(g2, B, 190, 20)text t2{text="2"}at(t2, B, 250, 8)input g1(G1)at(g1, B, 250, 20)text t1{text="1"}at(t1, B, 310, 8)input g0(G0)at(g0, B, 310, 20)text tG{text="<- buffer goal: rope on = release only while buffer < goal"}at(tG, B, 370, 24)"TI CD4585B"(A0=Q0, A1=Q1, A2=Q2, A3=Q3, B0=G0, B1=G1, B2=G2, B3=G3, EQIN=VCC, LTIN=GND, GTIN=GND, LT=QLT, EQ=QEQ, GT=QGT)"TI CD4585B"(A0=Q4, A1=Q5, A2=Q6, A3=Q7, B0=GND, B1=GND, B2=GND, B3=GND, LTIN=QLT, EQIN=QEQ, GTIN=QGT, LT=LOW)reconnect(NDONE.C = ROPE)reconnect(NDONE.I = NROPE)reconnect(SRST.E = LOW)reconnect(SRST.F = NROPE)reconnect(SRST.L = ROK)reconnect(A5.C = RELS)reconnect(A5.D = ROK)reconnect(A5.K = RELR)reconnect(src.RELEASE = RELR)

¿No te sale? Algo no funciona →