0% found this document useful (0 votes)
10 views20 pages

Tutorial1 (Numbers Systems)

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views20 pages

Tutorial1 (Numbers Systems)

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CSE 111: Logic

Sheet 1: Numbering Systems

Ahmed Fathy AbouElhamayed - 2021


Base Base Base Base
16 10 8 2
0 0 0 0
1 1 1 1 Decimal Octal Hexadecimal
2 2 2 10 16
3 3 3 11 17
4 4 4 100 18
5 5 5 19
6 6 6 20
7 7 7
21
8 8 10
22
9 9 11
23
A 10 12
24
B 11 13
25
C 12 14
26
D 13 15
27
E 14 16
F 15 17 28
10 16 20 29
30
31
32
Base b. Number of Digits n.
Base Base Base Base How many different numbers you can represent?
16 10 8 2
What is the max. number you can represent?
0 0 0 0
1 1 1 1
2 2 2 10
3 3 3 11
4 4 4 100
5 5 5 101
6 6 6 110
7 7 7 111
8 8 10 1000
9 9 11 1001
A 10 12 1010
B 11 13 1011
𝑵𝒖𝒎𝒃𝒆𝒓 𝒐𝒇 𝒅𝒊𝒇𝒇𝒆𝒓𝒆𝒏𝒕 𝒏𝒖𝒎𝒃𝒆𝒓𝒔 𝒚𝒐𝒖 𝒄𝒂𝒏 𝒓𝒆𝒑𝒓𝒆𝒔𝒆𝒏𝒕 = 𝒃𝒏
C 12 14 1100
D 13 15 1101
𝒏
E 14 16 1110 𝑴𝒂𝒙. 𝑵𝒖𝒎𝒃𝒆𝒓 𝒚𝒐𝒖 𝒄𝒂𝒏 𝒓𝒆𝒑𝒓𝒆𝒔𝒆𝒏𝒕 = 𝒃 -1
F 15 17 1111
10 16 20
Base b. Number of Digits n.
How many different numbers you can represent?
What is the max. number you can represent?
𝒏
𝑵𝒖𝒎𝒃𝒆𝒓 𝒐𝒇 𝒅𝒊𝒇𝒇𝒆𝒓𝒆𝒏𝒕 𝒏𝒖𝒎𝒃𝒆𝒓𝒔 𝒚𝒐𝒖 𝒄𝒂𝒏 𝒓𝒆𝒑𝒓𝒆𝒔𝒆𝒏𝒕 = 𝒃
𝒏
𝑴𝒂𝒙. 𝑵𝒖𝒎𝒃𝒆𝒓 𝒚𝒐𝒖 𝒄𝒂𝒏 𝒓𝒆𝒑𝒓𝒆𝒔𝒆𝒏𝒕 = 𝒃 -1

64, Max number = 63


256, Max number = 255
65536, Max number = 65535
Convert from any base to decimal

_ ! = ? "#

123 "# =

𝑥𝑦𝑧 ! =

𝐴𝐵 "$ = 171 "#


Convert from any base to decimal

_ ! = ? "#
123 =1∗ 10% +2∗ 10" +3∗ 10#
"#

𝑥𝑦𝑧 =𝑥∗ 𝑏 % +𝑦 ∗ 𝑏 " +𝑧 ∗ 𝑏 #


!

260 !"

285 !"

280 # =
Convert from any base to decimal

_ ! = ? "#
123 =1∗ 10% +2∗ 10" +3∗ 10#
"#

𝑥𝑦𝑧 =𝑥∗ 𝑏 % +𝑦 ∗ 𝑏 " +𝑧 ∗ 𝑏 #


!

22.3125 !"

56026.6875 !"
Convert from decimal to any base

_ "# = ? !
X b
b
b

20 16 4 1.25 25 !" = 14 !$
1 16 1 0.0625
0 16
= 515 #
Convert between Base 16(Hexadecimal) and Base 2(Binary)

𝐶1 !" = ? # 𝐶1 !" = 1100 0001 #

11011 # = ? !" 0001 1011 # = 1𝐵 !"


Base Base Base Base BCD
16 10 8 2
0 0 0 0
1 1 1 1
2 2 2 10
3 3 3 11 10
4 4 4 100
5 5 5 101
6 6 6 110
7 7 7 111
8 8 10 1000 23
9 9 11 1001
A 10 12 1010
B 11 13 1011
C 12 14 1100
D 13 15 1101
E 14 16 1110
F 15 17 1111
10 16 20 10000
Decimal Binary BCD Hexadecimal
12 1100 00010010 C
15 1111 00010101 F
27 11011 00100111 1B
96 1100000 10010110 60
Addition

96
+
38
134

=1001111
1s Complement and 2s Complement of a binary number

Number 1010
1s Complement 0101
2s Complement 0110
1s
Complement 01010101 00000000 11111111

2s
Complement 01010110 00000001 00000000
Notes

• Solve Assignment and deliver online via LMS.


• Attend in your section only(Attendance is mandatory.)

You might also like