|
3 posts
|
Hi all, could anyone explain to me what bitwise is please? I have no idea what it is and I have searched online about it but can't find anything about it and I'm struggling to do the ALU part of the course without it! Thank you :)
|
Administrator
2607 posts
|
Bit-wise means one bit at a time. For example, bit-wise And means that each bit position in the operands is treated independently, i.e., like the And16 you built in chapter 1.
--Mark
|
3 posts
|
Thank you for your reply, I understand it a bit better now. I know it may be a silly question but why it is used?, I don't understand why
|
566 posts
|
A basic case is for boolean logic. Other cases include bitmasks and a variety of other "clever" use cases. Can you look online to discover more?
|
566 posts
|
In other words, bitwise negation is logical negation (!) while arithmetic negation is, well, arithmetic negation (-).
|
3 posts
|
thank you for replying! I don't get the difference between normal AND and bitwise AND?
|
566 posts
|
For Hack, you can think of them as being the same.
|
|