Conversion and data representation algorithms – Exercises

Name:

Neptun code:

Date:


Conversion algorithms

(1) Converting a hexadecimal number to a decimal number Trials

hexadecimal number: decimal number: result:

Calculation:
* + * + * + *

0 0
(2) Converting a binary number to a decimal number Trials

binary number: decimal number: result:

Calculation:
* + * + * + * +
* + * + * + *

0 0
(3) Converting a decimal number to a binary number Trials

decimal number: binary number: result:

Calculation (quotient | remainder):
|
|
|
|
|
|
|
|

0 0
(4) Converting a binary number to a hexadecimal number Trials

binary number: hexadecimal number: result:

Calculation (tetrad = decimal digit = hexadecimal digit):
= =
= =
= =

0 0
(5) Converting a decimal number to a hexadecimal number Trials

decimal number: hexadecimal number: result:

Calculation (quotient | remainder):
|
|
|
|

0 0
(6) Converting a binary fraction to a decimal fraction Trials

binary fraction: decimal fraction: result:

Calculation:
* + * + * + *

0 0
(7.1) Converting a decimal fraction to a binary fraction (first five fractional digits after the binary point, e.g. 0.10001): Trials

decimal fraction: binary fraction: result:

Calculation (product → integer part + fractional part):
+
+
+
+
+

0 0
(7.2) Converting a rational fraction to a binary fraction (first five fractional digits after the binary point, e.g. 0.10001): Trials

rational fraction: binary fraction: result:

Calculation (product → integer part + fractional part):
/ + /
/ + /
/ + /
/ + /
/ + /

0 0

Data representation algorithms

(8) Transforming a decimal number into two's complement representation (in 8 bits): Trials

decimal number: 8-bit binary complement code: result:

Calculation:



0 0
(9) Transforming an integer represented as an 8-bit binary complement into a decimal number Trials

8-bit binary complement code: decimal number: result:

Calculation:



0 0
(10) Converting a decimal number to a signed packed BCD format: Trials

decimal number: packed BCD code: result:

Calculation (leading zero/decimal digit → tetrad):



0 0
(11) Converting an integer in signed unpacked BCD format to a decimal number: Trials

unpacked BCD code: decimal number: result:

Calculation (bit sequence → decimal digit):

0 0
(12) Converting a real number in floating-point format to a decimal number: (4 points): Trials

floating-point number: decimal number:  result: 

Calculation:
(sign)
= (encoded exponent → exponent)
.... = + + + + = (mantissa)

0 0
Sum total: 0 0
Result: ? point(s)
Percentage: ?


István Boda, 2023-2025.