Skip to content

Commit 8d2180a

Browse files
committed
Added bit readme
1 parent a2e9429 commit 8d2180a

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## Bits (Work In Progress)
2+
3+
### Basic Operators
4+
5+
AND:
6+
| x | y | x & y |
7+
-----------------
8+
| 0 | 0 | 0 |
9+
| 0 | 1 | 0 |
10+
| 1 | 0 | 0 |
11+
| 1 | 1 | 1 |
12+
13+
OR:
14+
| x | y | x | y |
15+
-----------------
16+
| 0 | 0 | 0 |
17+
| 0 | 1 | 1 |
18+
| 1 | 0 | 1 |
19+
| 1 | 1 | 1 |
20+
21+
XOR:
22+
| x | y | x ^ y |
23+
-----------------
24+
| 0 | 0 | 0 |
25+
| 0 | 1 | 1 |
26+
| 1 | 0 | 1 |
27+
| 1 | 1 | 0 |
28+
29+
30+
### Shifts
31+
32+
1. Left Shift (<<):
33+
34+
1 << 3 = 8
35+
36+
00000001 << 3 = 00001000 (only showing 8 bits)
37+
38+
2. Right Shift:
39+
40+
Two types:
41+
42+
a. Signed Right Shift (>>):
43+
44+
b. Unsigned Right Shift (>>>):
45+
46+

0 commit comments

Comments
 (0)