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

Function setWireOnComponent16

components/components_test.go:403–414  ·  view source on GitHub ↗
(b Component, input int)

Source from the content-addressed store, hash-verified

401}
402
403func setWireOnComponent16(b Component, input int) {
404 var x uint16 = 0
405 for i := 15; i >= 0; i-- {
406 r := (input & (1 << x))
407 if r != 0 {
408 b.SetInputWire(i, true)
409 } else {
410 b.SetInputWire(i, false)
411 }
412 x++
413 }
414}
415
416func getValueOfOutput(b Component, outputBits int) int {
417 var x int = 0

Callers 3

testLeftShifterFunction · 0.85
testRightShifterFunction · 0.85

Calls 1

SetInputWireMethod · 0.65

Tested by

no test coverage detected