This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

bourne
bourne presents ...

2013/11/2

Bit by Bit

Demonstration of the 7 bitwise operators on Bytes

(Quick break from my other project)
Literally threw this together in an hour, let me know if any mistakes.

Click on "New Byte" to get a new ByteWindow on screen.
Can edit both numerical and bitstring fields.
Note: Bytes range [-128, 127]

Drag ByteWindows around.
Drag a ByteWindow (fully) into each shaded area (and no more than one per), to enable AND, XOR, and OR operators. Click on these operator buttons to get result.

Note: Cannot have more than 5 ByteWindows open at a time (click on 'x' button to close out. Also results will stack on each other)

OPERATORS
& And
^ Exclusive Or
| Inclusive Or
~ Inverse
<< Left Shift
>> Right Shift
>>> Unsigned Right Shift


Reusable GUI Components can be found here:
http://www.greenfoot.org/scenarios/7578

2814 views / 16 in the last 7 days

2 votes | 0 in the last 7 days

Tags: with-source gui bourne bitwise

open in greenfoot
Your browser is ignoring the <APPLET> tag.
HTML5 version not available | Scenario not running?
A new version of this scenario was uploaded on Sat Nov 02 03:51:21 UTC 2013 Fixed bug where could not edit bitstring with selecting bits, while at length cap.
SPowerSPower

2013/11/2

Very good visualisation: fun to play around with!
bournebourne

2013/11/2

Thanks! Hope it is useful in learning about the bitwise operators.

Want to leave a comment? You must first log in.

Who likes this?

FireChick SPower