assignment 1 marking - brock universityjorth/2p12/assignment 1... · 2019-05-30 · 1. convert 11...

17
COSC2P12 Spring 2019 Assignment 1 Due date is Friday May 31 at 16:00. Late date is Monday June 3 at 16:00. This assignment counts for 6% of your final grade. Total is 89 marks. Note: In all base conversion questions you should use the most efficient method possible unless the question specifically directs you to use some other method. You must show all of your work. If you don't show your work you will receive a poor grade. 1. Convert 11 01 01 01 10 10 to base 16, base 8 and base 4. This is most easily done by grouping digits. 1101 0101 1010 D 5 A 110 101 011 010 6 5 3 2 11 01 01 01 10 10 3 1 1 1 2 2 2 marks each for a total of 6 marks. If they used some other less efficient method deduct one mark each. 2. Convert 0110 0011 1010 to base 10 using the binary long division method. 3 marks for step 1, 2 marks for step 2, 1 mark for step 3, 1 mark for step 4, 1 mark for stating the final result. Total 8 marks.

Upload: others

Post on 07-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Assignment 1 marking - Brock Universityjorth/2P12/Assignment 1... · 2019-05-30 · 1. Convert 11 01 01 01 10 10 to base 16, base 8 and base 4. This is most easily done by grouping

COSC2P12 Spring 2019Assignment 1

Due date is Friday May 31 at 16:00. Late date is Monday June 3 at 16:00. This assignment counts for 6% of your final grade. Total is 89 marks.

Note: In all base conversion questions you should use the most efficient method possible unless the question specifically directs you to use some other method. You must show all of your work. If you don't show your work you will receive a poor grade.

1. Convert 11 01 01 01 10 10 to base 16, base 8 and base 4.

This is most easily done by grouping digits.

1101 0101 1010D 5 A

110 101 011 010 6 5 3 2

11 01 01 01 10 10 3 1 1 1 2 2

2 marks each for a total of 6 marks. If they used some other less efficient method deduct one mark each.

2. Convert 0110 0011 1010 to base 10 using the binary long division method.

3 marks for step 1, 2 marks for step 2, 1 mark for step 3, 1 mark for step 4, 1 mark for stating the final result. Total 8 marks.

Page 2: Assignment 1 marking - Brock Universityjorth/2P12/Assignment 1... · 2019-05-30 · 1. Convert 11 01 01 01 10 10 to base 16, base 8 and base 4. This is most easily done by grouping
Page 3: Assignment 1 marking - Brock Universityjorth/2P12/Assignment 1... · 2019-05-30 · 1. Convert 11 01 01 01 10 10 to base 16, base 8 and base 4. This is most easily done by grouping

3. Convert 110100110 to base 5 using binary long division.

2 marks for step 1, 1 mark for step 2, 1 mark for step 3, 1 mark for step 2, 1 mark for stating the final result. Total 6 marks.

Page 4: Assignment 1 marking - Brock Universityjorth/2P12/Assignment 1... · 2019-05-30 · 1. Convert 11 01 01 01 10 10 to base 16, base 8 and base 4. This is most easily done by grouping

4. Convert 12102221203 to base 9.

The simplest method is to group digits. 12 10 22 21 20 = 538763 marks. If they used some other less efficient method deduct one mark.

5. Convert 335410 to base 2.

4 marks. If they make some mistake and get the wrong answer, but appear to have the correct concept, give one mark. Answer is 1101 0001 1010

6. Convert .3710 to a binary fraction of 10 binary digits.

4 marks.

Page 5: Assignment 1 marking - Brock Universityjorth/2P12/Assignment 1... · 2019-05-30 · 1. Convert 11 01 01 01 10 10 to base 16, base 8 and base 4. This is most easily done by grouping

7. Use two's compliment arithmetic to perform the following 8 bit binary operations.a. 0010 1110 + 0001 1011b. 0101 1101 – 0011 1010c. 1011 1000 – 1000 1011d. 1000 1100 – 1111 0111

2 marks each for a total of 8 marks

Page 6: Assignment 1 marking - Brock Universityjorth/2P12/Assignment 1... · 2019-05-30 · 1. Convert 11 01 01 01 10 10 to base 16, base 8 and base 4. This is most easily done by grouping

8. Convert 150.8476562510 to IEEE Floating Point Standard.

3 marks for the fraction, 2 marks for the exponent., 1 mark to put it all together. Total 6 marks.

Page 7: Assignment 1 marking - Brock Universityjorth/2P12/Assignment 1... · 2019-05-30 · 1. Convert 11 01 01 01 10 10 to base 16, base 8 and base 4. This is most easily done by grouping

9. Simplify the following Boolean expressions.a. xy + xy + xzb. (w + x)(x + y)(w + x + y + z) + x + y + w (Hint: This should evaluate to True.)c. w x y z + w x y z + w x y z (Hint: You answer should involve xor)d. a b c d + a b c d + a b c d + a b c d

There is probably more than one way of reducing each of these. As long as they get the right reduction and their steps look logical, give them full marks.2 marks for a. 4 marks for b. 3 marks for c. 3 marks for d. Total 12 marks.

Page 8: Assignment 1 marking - Brock Universityjorth/2P12/Assignment 1... · 2019-05-30 · 1. Convert 11 01 01 01 10 10 to base 16, base 8 and base 4. This is most easily done by grouping
Page 9: Assignment 1 marking - Brock Universityjorth/2P12/Assignment 1... · 2019-05-30 · 1. Convert 11 01 01 01 10 10 to base 16, base 8 and base 4. This is most easily done by grouping

10. Consider the following truth table. Construct a Karnaugh map for this truth table. Using the map, develop a simplified Boolean expression for the given table. Using Logic Circuit, build a circuit that implements the simplified Boolean expression. For marking purposes print your circuit and the Logic Circuit truth table. (Of course, the Logic Circuit truth table should match the truth table below.)

Page 10: Assignment 1 marking - Brock Universityjorth/2P12/Assignment 1... · 2019-05-30 · 1. Convert 11 01 01 01 10 10 to base 16, base 8 and base 4. This is most easily done by grouping

A B C D O

0 0 0 0 1

0 0 0 1 1

0 0 1 0 1

0 0 1 1 1

0 1 0 0 1

0 1 0 1 0

0 1 1 0 1

0 1 1 1 0

1 0 0 0 1

1 0 0 1 1

1 0 1 0 1

1 0 1 1 1

1 1 0 0 0

1 1 0 1 0

1 1 1 0 0

1 1 1 1 1

5 marks for the Karnaugh map and reduced expression. If they group terms some other way that results in a more complex expression take off a mark or two. 5 marks for the circuit and Logic Circuit truth table. Note: The circuit must implement the truth table correctly or they get zero for that part. Total10 marks.

Page 11: Assignment 1 marking - Brock Universityjorth/2P12/Assignment 1... · 2019-05-30 · 1. Convert 11 01 01 01 10 10 to base 16, base 8 and base 4. This is most easily done by grouping
Page 12: Assignment 1 marking - Brock Universityjorth/2P12/Assignment 1... · 2019-05-30 · 1. Convert 11 01 01 01 10 10 to base 16, base 8 and base 4. This is most easily done by grouping

11. Repeat the above instructions for the following truth table.

A B C D O

0 0 0 0 1

0 0 0 1 1

0 0 1 0 1

0 0 1 1 1

0 1 0 0 1

0 1 0 1 0

0 1 1 0 0

0 1 1 1 0

1 0 0 0 1

1 0 0 1 1

1 0 1 0 1

1 0 1 1 0

1 1 0 0 0

1 1 0 1 0

1 1 1 0 0

1 1 1 1 1

Use the same marking scheme as Q 10. Total 10 marks.

Page 13: Assignment 1 marking - Brock Universityjorth/2P12/Assignment 1... · 2019-05-30 · 1. Convert 11 01 01 01 10 10 to base 16, base 8 and base 4. This is most easily done by grouping
Page 14: Assignment 1 marking - Brock Universityjorth/2P12/Assignment 1... · 2019-05-30 · 1. Convert 11 01 01 01 10 10 to base 16, base 8 and base 4. This is most easily done by grouping

12. Using Logic Circuit build a full 1 bit adder. A full adder must implement this truth table:

Cin A B Cout S

0 0 0 0 0

0 0 1 0 1

0 1 0 0 1

0 1 1 1 0

1 0 0 0 1

1 0 1 1 0

1 1 0 1 0

1 1 1 1 1

Print your full adder circuit and the associated truth table. Package your full adder. Using the packaged full adder, build a 4 bit adder. Package your 4-bit adder. Place a 4 bit adder on Main. Provide 4 toggle buttons for the A digit inputs. Give them notations a0 to a3. Provide 4 toggle buttons for the B digit inputs. Give them notations b0 to b3. Provide 4 probes for the outputs. Name them s0 to s3. Also provide a probe for the final carry out. Name it cout. Run your circuit. Toggle the input switches to add 7 + 7. Take a screen capture of your circuit adding 7 + 7 and print it for marking purposes.

4 marks for the single bit adder and proper truth table. Truth table must be correct or they get zero for this part. 4 marks for the 4 bit adder that adds 7 + 7 (in binary 0111 + 0111) and gets the correct output of binary 1110 with no carry out. Total 8 marks.

Page 15: Assignment 1 marking - Brock Universityjorth/2P12/Assignment 1... · 2019-05-30 · 1. Convert 11 01 01 01 10 10 to base 16, base 8 and base 4. This is most easily done by grouping
Page 16: Assignment 1 marking - Brock Universityjorth/2P12/Assignment 1... · 2019-05-30 · 1. Convert 11 01 01 01 10 10 to base 16, base 8 and base 4. This is most easily done by grouping

13. This 4-bit adder will work perfectly for unsigned integers. However, if we attempt to do two's compliment arithmetic on it we can run into overflow problems. An overflow occurs when the addition of two positive numbers results in a negative sum or the addition of two negative numbers results in a positive sum. The Wikipedia entry for two's compliment explains how to detect overflow in an adder. Add an overflow detector to your 4-bit adder. Add an overflow probe to your 4-bit adder on Main. Run this circuit and toggle the switches to add 5 + 4. The overflow probe should be true. Take a screen capture of this and print it for marking. Your final circuit should look like this:

4 marks for the addition of the overflow pin which should be on when adding 4 + 5 (in binary 0100 + 0101 should add to 1001 with overflow on.) 4 marks

Page 17: Assignment 1 marking - Brock Universityjorth/2P12/Assignment 1... · 2019-05-30 · 1. Convert 11 01 01 01 10 10 to base 16, base 8 and base 4. This is most easily done by grouping

Note: you do not need to build a subtractor, as was shown on slides 16 and 17. The subtractor performs the two's compliment conversion. Your adder can assume the two's compliment conversion takes place externally.

Submission

This submission will be physically submitted due to the nature of the material. Thus, it will be your responsibility to ensure that it is printed and submitted prior to the due date listed above. The assignment must be deposited in the COSC2P12 drop box outside of J328.

A portion of this assignment may be hand written/drawn as appropriate. Please remember, that the marker must be able to read your writing, so it is important things be done neatly. If you would rather type it out, then so much the better. Make the marker happy!

Your submission should be contained in a large (8.5 inch x 11 inch) envelope.

You must include a cover sheet completely filled out, available from: "http://www.cosc.brocku.ca/forms/cover". Your assignment will not be marked unless a completed cover sheet is submitted with the assignment. This should be stapled to the outside of the envelope.

Printout of your logic circuit diagrams, with proper identification on each circuit printout. See lab 1.

Neatly written/printed/typed assignment material. Labeled and stapled together.