Unsigned Binary
Please Log In for full access to the web site.
Note that this link will take you to an external site (https://shimmer.mit.edu) to authenticate, and then you will be redirected back to this page.
Unsigned Binary Representation
Unsigned Binary Arithmetic
Bitwise Binary Operators: OR (|), AND (&), NOT (~), XOR (^), Left shift (<<), Right shift (>>)
For the following exercises assume that your bitwise operators take one or two numbers of equal width and perform operations on each of the bits producing a result of equal width. We will learn about what happens when the inputs are not of equal lengths next week.
What is the result of the following bitwise binary operations assuming all numbers are unsigned? Note that the only bitwise binary operator whose behavior depends on whether the number is signed or unsigned is the right shift operator. This will be covered in next week's two's complement exercise.
|
0b00101010 = 0b
&
0b10101010 = 0b
^
0b10101010 = 0b
Logical Binary Operators: Comparison (==, !=, <, <=, > >=), Logical AND (&&) , Logical OR (||), Logical NOT (!)
Logical operators take two numbers and produce a 0 (to indicate false) or 1 (to indicate true) output.
What is the result of the following logical comparisons assuming all values are unsigned?
What is the result of the following logical binary operations?