Kent



Lab 9 – Binary Conversions and Arithmetic

Dean Zeller Due: Wednesday, April 12th by 9:00 pm

CS10051 Lab: 10 points

Spring, 2006 Assignment: 10 points

Objective The student will convert binary integers to decimal, decimal to binary, and perform binary arithmetic (addition, subtraction, and multiplication).

Materials: Binary Calculator

You will need a calculator with binary number functionality. The Microsoft Windows calculator is sufficient for this assignment. The purpose of the calculator is to check your work on the assignments. It is still important for you to know the method behind the calculation, as calculators will not be allowed on the exam.

Background: Binary Numbers

The binary number system is used by computers to do every calculation and decision within a computer’s Central Processing Unit (CPU), and is also the system used for long and short term storage. It is helpful as computer scientists to know this number system very well. In the next few weeks, you will learn how circuits are designed to make calculations in this system.

Lab Notes (5 points)

Given below are five questions dealing with binary conversions and arithmetic. Solve the problems using the diagram method shown in class. Word processing is not necessary, but you are being graded on neatness.

Lab Report (5 points)

For each question below, choose one problem to demonstrate using a word processor and/or graphics package. Diagram your answer as shown in class.

Assignment 9 – Floating Point Binary

Objective The student will perform binary division, convert decimal fractions to floating point binary, convert floating point binary to decimal, and measure the error of 8-bit precision binary numbers.

Background: Floating Point Binary

This system of numbers is typically left out of computer architecture textbooks. Conceptually, floating point binary is no more difficult than decimal, just with a different “behavior.”

Assignment Notes (5 points)

Given below are five questions dealing with floating point binary. Solve the problems using the diagram method shown in class. Word processing is not necessary, but you are being graded on neatness.

Assignment Report (5 points)

For each question below, choose one problem to demonstrate using a word processor. Diagram your answer as shown in class.

Grading:

You will be graded on the following criteria:

Accuracy Correctly diagramming the solutions.

Organization Neatness and readability of the answers and diagrams

Extra Credit:

Extra credit will be given for any of the following:

• Create and solve your own problems.

• Use a word processor on all problems.

Lab 9 Questions

Question 1 Convert the following binary numbers to decimal.

| |0001 1001 |1111 1101 |0010 1001 1000 |

| |1101 0101 |0011 1010 |1110 1110 1110 |

Question 2 Convert the following decimal numbers to binary.

| |29 |250 |1000 |

| |78 |315 |2049 |

Question 3 Perform the following binary addition. Check your work for correctness, and make note of any addition overflow. (Diagramming not necessary for checking work.)

| | 1010 1100 | 1010 1000 | 1000 1000 1010 |

| |+ 100 1010 |+ 101 0111 |+ 11 1101 1100 |

| | | | |

| |1011 1011 |1100 0000 |1001 1100 1000 |

| |+ 111 0010 |+ 111 1111 |+ 1011 0100 0101 |

Question 4 Perform the following binary subtraction. Check your work for correctness. (Diagramming not necessary for checking work.)

| | 1011 1011 | 1010 1000 | 1011 1010 1010 |

| |– 100 1001 |– 101 1111 |- 11 1101 1100 |

| | | | |

| |1011 0110 |1110 1011 |1111 1100 1000 |

| |- 101 1001 |- 1101 1110 |- 1011 1100 0101 |

Question 5 Perform the following binary multiplication. Check your work for correctness. (Diagramming not necessary for checking work.)

| | 0000 1101 | 0010 1001 | 0010 1011 | |

| |( 111 |( 1 0101 |( 1 1101 | |

| | | | | |

| |0001 1010 |0010 0010 |1010 0011 | |

| |( 1101 |( 1 0010 |( 1 1111 | |

Assignment 9 Questions

Question 1 Perform the following binary integer division problems. Give a remainder for problems that do not divide evenly.

[pic] [pic] [pic] [pic] [pic] [pic] [pic] [pic] [pic]

Question 2 Convert the following fractions into binary. Continue until the binary number terminates or repeats. All numbers will terminate or repeat within 10 bits, most are 3 to 5 bits.

1/5 1/7 1/10 1/20 3/8 1/14 1/13 3/16 3/32 3/64

3/16 3/32 61/64 5/16 6/19 .2 .3 .7125 .796875 .00390625

Question 3 Convert the following 8-bit precision floating point binary numbers into decimal.

0.0110 10002 0.1000 01002 0.1111 11112 0.0000 00112

0.0000 00012 0.1010 10102 0.1000 01002 0.0101 01002

Question 4 Convert .0525 and .995 into floating point binary. Continue until the binary number terminates or repeats. (Hint: you will probably need a whole page to do this problem.)

Question 5 Give the 8-bit precision floating point binary representation for the following decimal numbers. Convert your answer back into decimal and indicate the difference between the two decimal values.

.53 .42 .10 .75 .73 .25 .99 .01 .51 .24

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download