()
| 14 | } |
| 15 | |
| 16 | func NewDecoder2x4() *Decoder2x4 { |
| 17 | d := new(Decoder2x4) |
| 18 | |
| 19 | for i, _ := range d.notGates { |
| 20 | d.notGates[i] = *circuit.NewNOTGate() |
| 21 | } |
| 22 | |
| 23 | for i, _ := range d.andGates { |
| 24 | d.andGates[i] = *circuit.NewANDGate() |
| 25 | } |
| 26 | |
| 27 | return d |
| 28 | } |
| 29 | |
| 30 | func (d *Decoder2x4) GetOutputWire(index int) bool { |
| 31 | return d.outputs[index].Get() |