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

Report as inappropriate.

bourne presents ...


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)

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

Reusable GUI Components can be found here:

2293 views / 406 in the last 7 days

2 votes | 0 in the last 7 days

Tags: with-source gui bourne bitwise

open in greenfoot

There is no HTML 5 translation of this scenario available.
View legacy version (requires Java plugin)

This scenarios uses Java features that are not available for use after conversion to HTML 5. Please try the legacy version, which requires the Java plugin to be installed.

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.


Very good visualisation: fun to play around with!


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