






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
An overview of number systems, focusing on the differences between analog and digital signals, binary representation systems, and the conversion of decimal numbers to binary. Students will learn about the concept of place values, the conversion of decimal numbers to binary using powers of 2, and the use of shortcuts for binary, octal, and hexadecimal conversions.
Typology: Slides
1 / 12
This page cannot be seen from the preview
Don't miss anything!
3
(A thru F = 10 thru 15)
-^
10
2
10
2 =100 10
1 =10 10
0 =1 10
=0.
(^32) =8 2
2 =
(^12) =2 2
0 =1 2
=0.5 2
=0.
-^
10
__
__
__
__
-^
10
2
10
2 =100 10
1 =10 10
0 =1 10
=0.
(^32) =8 2
2 =
(^12) =2 2
0 =1 2
=0.5 2
=0.
-^
10
2
16
8
4
2
1
3
8
2
4
16
2
-^
Unsigned
-^
Unsigned (Normal) binary
Signed
-^
Signed Magnitude
-^
2’s complement
-^
1’s complement*
-^
Excess-N*
-^
For very large and small(fractional) numbers
-^
Text
-^
ASCII / Unicode
Decimal Codes
BCD (Binary Coded Decimal)/ (8421 Code)
Main Point: Given n digits of base r,
unique numbers
can be made with the range [_________]
2-digit, decimal numbers (r=10, n=2)3-digit, decimal numbers (r=10, n=3)4-bit, binary numbers (r=2, n=4)6-bit, binary numbers
(r=2, n=6)
0-
0-
100 combinations:
00-
0-
0-
0-
0-
1000 combinations:
000- 16 combinations:
0000- 64 combinations: 000000-
-^
16
32
-^
10
20
30
40
-^
10
20
30
10
16-bit half word: ___ numbers
32-bit word: ____ numbers
64-bit dword: 16 million trillion numbers
(^162)
= (^242)
= (^282)
= (^322)
=
n
Colors of the rainbow:•Red = 000•Orange = 001•Yellow = 010•Green = 100•Blue = 101•Purple = 111
Letters:•‘A’ = 00000•‘B’ = 00001•‘C’ = 00010
...
•‘Z’ = 11001
‘H’ = 0x48, ‘e’ = 0x65, …
-^
\n = newline character is represented by either one or two ASCIIcharacter
LF (0x0A) = line feed (moves cursor down a line) - CR (0x0D) = carriage return character (moves cursor to start of currentline) - Newline for Unix / Mac = LF only - Newline for Windows = CR + LF
LSD/MSD
0
1
2
3
4
5
6
7
0
NULL
DLW
SPACE
0
@
P^
`^
p
1
SOH
DC
!^
1
A^
Q^
a^
q
2
STX
DC
“^
2
B^
R^
b^
r
3
ETX
DC
#^
3
C^
S^
c^
s
4
EOT
DC
$^
4
D^
T^
d^
t
5
ENQ
NAK
%
5
E^
U^
e^
u
6
ACK
SYN
&
6
F^
V^
f^
v
7
BEL
ETB
‘^
7
G^
W
g^
w
8
BS
CAN
(^
8
H^
X^
h^
x
9
TAB
EM
)^
9
I^
Y^
i^
y
A^
LF
SUB
*^
:^
J^
Z^
j^
z
B^
VT
ESC
+^
;^
K^
[^
k^
{
C^
FF
FS
,^
<^
L^
^
l^
|
D^
CR
GS
-^
=^
M
]^
m
}
E^
SO
RS
.^
^
N^
^^
n^
~
F^
SI
US
/^
?^
O^
_^
o^
DEL
'M' = 0x4D = 0100 1101
ASCII can represent only the Englishalphabet, decimal digits, andpunctuation^ –
7-bit code => 2
7 = 128 characters
It would be nice to have one codethat represented morealphabets/characters for commonlanguages used around the world
Unicode^ –
Up to 32-bit Code => up to 4 billioncombinations
137,000 character defined for manylanguages
Used by Java as standard charactercode
Unicode hex value
(i.e. FB52 => 1111101101010010)
-^
True/False
Question
In C/C++: '1' and 1 are the same.- '1' is replaced with its equiv. _______________________- Thus, storing '1' or ______________ to a char variable are allequivalent (the hardware does not ___________ how the bits willbe interpretated…that is up to the code)
chars and ints have different ranges of the values they canrepresent.-^
Range of char: _________________
-^
chars are only for ASCII characters(e.g.
char c =
and not
char c =
10
10
10
2 =
10
1 =
10
0 =
10
=0.
2
10
2 3 =
2 2 =
2 1 =
-1 2
=0.
16
10
16
1 =
16
0 =
16
=0.
Main Point
: To convert any base to decimal (base 10), apply the
implicit place values (weights) which are just the powers of the
base and sum each digit times its place value.
i
Left-most digit =Most Significant
Digit (MSD)
Right-most digit =Least Significant
Digit (LSD)
r^
-
-
3
2
1
0
-
-
-
-
Number in base r
Decimal Equivalent
3
2
1
0
-
-
Generalized approach: Example:
. 1 2 4 8
16 32
128
1
512
256
128
64
32
16
8
4
2
1
1024
0
4
5
6
7
8
9
10
16
8
4
2
1
25
10
=
1
1
1
32
For 25
10
the place value 32 is too large to include so we include
16. Including 16 means we have to make 9 left over. Include 8
and 1.
0
0
0