ScratchData LogoScratchData
Back to kriblo_test's profile

Example: Bitwise AND

KRkriblo_test•Created April 16, 2021
Example: Bitwise AND
2
1
24 views
View on Scratch

Instructions

Bitwise operation, although not present in Scratch, is common in other programming languages. Bitwise, is when you compare the individual bits of two numbers. Individual bits of data are best represented in binary format (zeros and ones). Bitwise operations result in the same number of bits as in the data compared. A group of eight bits is called a byte. One bitwise operation is AND, where the resultant bit is 1 if both compared bits are 1, otherwise it's 0. AND is used as an example in this project. Learn more about Bitwise operation on Wikipedia: https://en.wikipedia.org/wiki/Bitwise_operation All code by me (@kriblo). Study the code inside to understand how bitwise operations work. The custom block "BINARY_RESULT...", which convert a decimal number to binary, might also help you understand how the binary format works. That custom block is also a fairly simple example of a recursive procedure, as it keeps calling itself until it's done.

Project Details

Project ID516649007
CreatedApril 16, 2021
Last ModifiedOctober 27, 2021
SharedApril 16, 2021
Visibilityvisible
CommentsAllowed