MCPcopy Create free account
hub / github.com/djhworld/simple-computer / Update

Method Update

components/decoders.go:34–49  ·  view source on GitHub ↗
(inputA bool, inputB bool)

Source from the content-addressed store, hash-verified

32}
33
34func (d *Decoder2x4) Update(inputA bool, inputB bool) {
35 d.inputA.Update(inputA)
36 d.inputB.Update(inputB)
37
38 d.notGates[0].Update(d.inputA.Get())
39 d.notGates[1].Update(d.inputB.Get())
40
41 d.andGates[0].Update(d.notGates[0].Output(), d.notGates[1].Output())
42 d.andGates[1].Update(d.notGates[0].Output(), d.inputB.Get())
43 d.andGates[2].Update(d.inputA.Get(), d.notGates[1].Output())
44 d.andGates[3].Update(d.inputA.Get(), d.inputB.Get())
45
46 for i, _ := range d.outputs {
47 d.outputs[i].Update(d.andGates[i].Output())
48 }
49}
50
51type Decoder3x8 struct {
52 inputA circuit.Wire

Callers 1

Test2x4DecoderFunction · 0.95

Calls 3

UpdateMethod · 0.65
GetMethod · 0.45
OutputMethod · 0.45

Tested by 1

Test2x4DecoderFunction · 0.76