NVIDIA interview question

implement some low level functionality at the gate level