Lecture notes for the Introduction to Computer Science I by James Tam | Return to the course web page |
Grade out of 18 | Letter |
18 | A+ |
17 | A |
16 | A- |
15 | B+ |
14 | B |
13 | B- |
12 | C+ |
11 | C |
10 | C- |
9 | D+ |
8 | D |
7 | D- |
Less than 7 | F |
Number system |
|||
Value in decimal |
Value in binary |
Value in Octal |
Value in Hexadecimal |
100010 | 42 | 22 | |
255 | 377 | FF | |
256 | 100000000 | 100 | |
16.25 | 10000.010 | 20.2 |
0 |
1 |
0 |
1 |
1 | 0 | 1 | 1 |
|
1 |
0 |
0 |
1 |
||||
+ |
0 |
0 |
1 |
1 |
- | 0 | 0 | 1 | 0 |
|
- |
0 |
1 |
1 |
0 |
|
Number system |
||
Unsigned binary value |
One’s complement value |
Two’s complement value |
01011 | 01011 | |
-01111 | 10001 | |
10111 | 11000 |
One's complement negate and add | Two's complement negate and add | ||||||||||
|
0 | 1 | 0 | 1 |
|
|
0 | 0 | 1 | 1 | |
- |
0 | 1 | 0 | 0 |
|
|
- | 0 | 1 | 0 | 0 |
1's |
|
2's |
|
||||||||
U/S |
|
U/S |
|
(AND)
|
T | T | T | F | F | F |
AND |
F | T | F | T | F | T |
|
(OR)
|
T | T | T | F | F | F |
OR |
F | T | F | T | F | T |
|
(XOR)
|
T | T | T | F | F | F |
XOR |
F | T | F | T | F | T |
|
(NAND)
|
T | T | T | F | F | F |
NAND |
F | T | F | T | F | T |
|
(NOR)
|
T | T | T | F | F | F |
NOR |
F | T | F | T | F | T |
|