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

Function checkRegisterOutput

components/register_test.go:155–165  ·  view source on GitHub ↗
(r *Register, expected uint16)

Source from the content-addressed store, hash-verified

153}
154
155func checkRegisterOutput(r *Register, expected uint16) bool {
156 var result uint16
157 for i := arch.BUS_WIDTH - 1; i >= 0; i-- {
158 if r.outputs[i].Get() {
159 result = result | (1 << uint16(i))
160 } else {
161 result = result & ^(1 << uint16(i))
162 }
163 }
164 return result == expected
165}
166
167func setBus(b *Bus, value uint16) {
168 for i := arch.BUS_WIDTH - 1; i >= 0; i-- {

Callers 1

Calls 1

GetMethod · 0.45

Tested by

no test coverage detected