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

Method Update

components/components.go:411–427  ·  view source on GitHub ↗
(inputA, inputB, equalIn, isLargerIn bool)

Source from the content-addressed store, hash-verified

409}
410
411func (g *Compare2) Update(inputA, inputB, equalIn, isLargerIn bool) {
412 g.inputA.Update(inputA)
413 g.inputB.Update(inputB)
414 g.equalIn.Update(equalIn)
415 g.isLargerIn.Update(isLargerIn)
416
417 g.xor1.Update(g.inputA.Get(), g.inputB.Get())
418 g.not1.Update(g.xor1.Output())
419 g.and1.Update(g.not1.Output(), g.equalIn.Get())
420 g.equalOut.Update(g.and1.Output())
421
422 g.andgate3.Update(g.equalIn.Get(), g.inputA.Get(), g.xor1.Output())
423 g.or1.Update(g.andgate3.Output(), g.isLargerIn.Get())
424 g.isLargerOut.Update(g.or1.Output())
425
426 g.out.Update(g.xor1.Output())
427}
428
429type Comparator struct {
430 inputs [arch.BUS_WIDTH * 2]circuit.Wire

Callers 1

TestCompare2Function · 0.95

Calls 3

UpdateMethod · 0.65
GetMethod · 0.45
OutputMethod · 0.45

Tested by 1

TestCompare2Function · 0.76