0% found this document useful (0 votes)
82 views8 pages

CEA201 - Lab01 - Ver 1.1

The document provides exercises on binary, octal, hexadecimal and decimal number systems. It includes converting between these number systems as well as arithmetic operations. Students are asked to complete the exercises and submit their work.

Uploaded by

Anh Ngọc Lê
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views8 pages

CEA201 - Lab01 - Ver 1.1

The document provides exercises on binary, octal, hexadecimal and decimal number systems. It includes converting between these number systems as well as arithmetic operations. Students are asked to complete the exercises and submit their work.

Uploaded by

Anh Ngọc Lê
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Họ Tên:

Lớp Mã SV: HE194950

Duration: 90’
Lab 1:
Objective:
q Describe the decimal, binary, hexadecimal, and octal system.
q Convert a number in binary, octal, or hexadecimal to a number in the decimal system.
q Convert a number in the decimal system to a number in binary, octal, and hexadecimal.
q Convert a number in binary to octal and vice versa.
Materials:
Based on exercises of chapter 2 in the textbook “Foundations Of Computer Science, 4nd Edition, Behrouz Forouzan, 2017.”
Student's task:
- Review the whole chapter 2 content in the textbook.
- Write down solutions to exercises (step by step)
- Finish exercises and submit the results to the lecturer in class.
Scoring scale: 10

Exercise 1 (2.5 marks): Convert decimal numbers to binary ones

# Decimal 4-bit Binary Decimal 8-bit Binary Decimal


1 9 1001 7 0000 0111 255
2 6 44 182
3 2 120 203
4 15 184 430
5 12 168 5571
6 11 52 251
7 4 85 543
8 5 42 896
9 8 98 1127
10 13 98 2164
11 14 117 92

Exercise 2 (2.5marks): Convert decimal numbers to binary and hexadecimal ones

# Decimal 8-bit Binary Hexa Decimal Hexa


1 7 0111 7 255 FF
2 44 182
3 120 203
4 184 430
5 168 5571
6 52 251
7 85 543
8 42 896
9 98 1127
10 98 2164
11 117 92
Exercise 3 (2.5 marks): Compute (b: binary, q: octal, h: hexadecimal)

# expression result (binary) result (hexa)


1 3556(q) + 270(q)
2 1A9B(h) + 6FE0(h)
3 0101101101(b) - 100111001(b)
4 3056(q) - 357(q)
5 9AB8(h) -0FA(h)
6 3A9B(h) - 707(q)
7 65AE(h) - 1001101(b)
8 11001001(b) + 0CE(h) - 355(q)
9 1001000111(b) + 9FE(h) + 407(q)

Exercise 4 (2.5 marks)

1. Show binary formats of 1-byte unsigned numbers


Decimal Binary
240
170
127

2. Show binary formats of 2-byte unsigned numbers:


Decimal Binary
552
171
443

3. Show binary formats of 1-byte signed numbers:


Decimal Binary
-52
-159
-109
340

4. Show the decimal values of 1-byte signed:

Binary Decimal
01001100
10010100
01100011
10111011
Edition, Behrouz Forouzan, 2017.”

16-bit Binary
0000 0000 1111 1111

cimal ones

16-bit Binary
0000 0000 1111 1111
result (octal)
Dec Oc
X= 0 0
Y= 5 5
Z= 9 2

Bài 1
Old Add New
44 X 44
115 Y 120
175 Z 184
168 X 168
47 Y 52
76 Z 85
37 Y 42
98 X 98
89 Z 98
108 Z 117

Old Add New


182 X 182
198 Y 203
421 Z 430
5571 X 5571
246 Y 251
534 Z 543
891 Y 896
1127 X 1127
2155 Z 2164
83 Z 92

Bài 3
Thay các ký tự "X", "Y", "Z" vào các số cần thay thế, riêng biểu thức kiểu bin thì sẽ lựa chọn vị trí đảo bit của số thứ nhất

3Y56(q) + 27X(q) 3556(q) + 270(q)


1AZB(h) + 6FEX(h) 1A9B(h) + 6FE0(h)
1101101101(b) - 100111001(b) X 0101101101(b) - 100111001(b)
3X56(q) - 3Y7(q) 3056(q) - 357(q)
ZAB8(h) -XFA(h) 9AB8(h) -0FA(h)
3AZB(h) - 7X7(q) 3A9B(h) - 707(q)
6YAE(h) - 1001101(b) 65AE(h) - 1001101(b)
11001001(b) + XCE(h) - 3Y5(q) 11001001(b) + 0CE(h) - 355(q)
1001000111(b) + ZFE(h) + 4X7(q) 1001000111(b) + 9FE(h) + 407(q)

Bài 4
Old Add New
240 X 240
165 Y 170
118 Z 127
Old Add New
552 X 552
166 Y 171
434 Z 443

Old Add New


-52 X -52
-164 Y -159
-118 Z -109
331 Z 340

Old Add New Bin


01001100 76 X 76 01001100
10001111 -113 Y -108 10010100
01011010 90 Z 99 01100011
10110010 -78 Z -69 10111011
bit của số thứ nhất
1 2 3 4 5 6 7 8
0 1 0 0 1 1 0 0
1 0 0 0 1 1 1 1
0 1 0 1 1 0 1 0
1 0 1 1 0 0 1 0
64 32 16 8 4 2 1
0 1 1 0 1 0 0
1 1 1 0 0 0 1
0 1 0 0 1 1 0
1 0 0 1 1 1 0

76 38 19 9 4 2 1 0
108 54 27 13 6 3 1 0
99 49 24 12 6 3 1 0
69 34 17 8 4 2 1 0
0 0 1 1 0 0 1 0
0 0 1 1 0 1 1 0
1 1 0 0 0 1 1 0
1 0 1 0 0 0 1 0

0 0 1 0 1 1 0
0 0 1 0 1 0 0
1 0 1 1 1 0 0
1 1 0 1 1 1 0

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy