You will build three tools that a processor uses on an 8-bit register. Every value is a string of eight 0s and 1s.
Your tasks.
add8, return the 8 bits that the register keeps after adding a and b, and True if there was an overflow (else False).left_shift, return the register after a logical left shift of places places. Bits that fall off the left are lost.twos, return the 8-bit two's complement pattern of a number from to .Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…