Ect109Week1Lab2

Name: ________________________________ Grade: __________




Title: Converting decimal numbers to binary




OBJECTIVES


In this lab, you will develop an algorithm to convert decimal numbers to binary numbers. Then, apply the algorithm to several decimal numbers to obtain their binary equivalent.





II. PROCEDURE

To convert a decimal number to its equivalent binary number, use the following procedure.



Divide the decimal number by two and record the quotient and remainder, R. The quotient obtained is the next number to be divided by two. The remainder is the value of the binary digit for that position. Continue the division until the answer is 0 with a remainder of 1. The remainder is the most significant bit of the binary conversion.



The procedure below demonstrates how to convert the decimal number 12 to its four bit binary equivalent.

























12 / 2 = 6 R 0 LSB










6 / 2 = 3 R 0













3 / 2 = 1 R 1










1 / 2 = 0 R 1 MSB







      Four Bit Binary equivalent                             1           1           0           0













Problems:

1. Using the process described above, convert the following decimal numbers to their four bit binary equivalent. Record your results.

    a. 10 =   1010

    b. 15 = 1111

2. What is the largest decimal number that can be generated in four binary bits? How did you arrive at this result? 15, I arrived at this result by using the code 1111 and using the conversion of 2 to the power of 3 and then 2 to the power of 2 and then 2 to the power of 1 and then 2 to the power of 0. All of that equals 8/4/2/1. So when you multiply those numbers by the corresponding four bit numbers you end up with 8/4/2/1 and then if you add that up you get 8+4+2+1= 15.



3. Extend the process described above and convert the following decimal numbers to their eight bit...