You are on page 1of 6

Jeddah College of Technology Electrical Technology Department

Devised by : DR. MAROUANI.I

digital electronic

Experimental work N° 1 :

Number Systems and Base Conversions

Name& surname:

AY : 2016/2017 Page 1

meritocracy

Study the technique used to Converting a number from base to an other

base in Matlab.

objective

study of algorithms used for the three conversions operations : coding,

decoding and transcoding in matlab.

Check your results manually.

AY : 2016/2017 Page 2

Exercises

DECODING:

In Exercises 1-4, use hand calculations (and a calculator) to change each of the

n mbers in the gi en base to base ten. Use Matlab s base2dec command to

check your answer.

Bm 10(N) =(?)10 ; se : * If m 2 : base2dec( N ,m)

* If m=2 : bin2dec( N )

1. (3565)7

2. (2102)3

3. (11111111)2

4. (111011011)2

Complete the following table

Results of simulation Results of calculation

(3565)7 = (3565)7 =

(2102)3 = (2102)3 =

(11111111)2 = (11111111)2 =

(111011011)2 = (111011011)2 =

AY : 2016/2017 Page 3

CODING:

In Exercises 5-8, use the tabular technique to change each of the given base ten

integers to base two. Check your results with Matlab s dec2bin command.

(N)10=(?)m 10. Use : * If m=16 : dec2hex(N)

* If m=2 : dec2bin(N)

5. (127)10 = ( ? )2 = ( ? )16 .

6. (67)10 = ( ? )2 = ( ? )16 .

7. (255)10 = ( ? )2 = ( ? )16 .

8. (256)10 = ( ? )2 = ( ? )16 .

Complete the following table

Results of simulation Results of calculation

B10 B2 B16 B10 B2 B16

127 127

67 67

255 255

256 256

AY : 2016/2017 Page 4

TRANSCODING:

In Exercises 9-12, use hand calculations to place each of the given binary

numbers in hexadecimal format. Use Matlab s bin2dec and dec2hex commands

to check your work.

(N)m = (?)n , ith m n 10.

Use the passage by B10.

(N)2=(?)10 se :bin2dec( N )

(N)10=(?)16 use : dec2hex(N)

9. (11110101)2

10. (1110011101011001)2

11. (11111101101010010101111110101100)2

12. (11101101101010010101111110111100)2

In Exercises 13-16, Use the tabular method demonstrated in course to place each of the given

base ten integers into binary format. Then place your result in hexidecimal format. Check

o r res lts ith Matlab s dec2bin and dec2hex commands.

13. 143

14. 509

15. 1007

16. 12315

AY : 2016/2017 Page 5

You might also like