0% found this document useful (0 votes)
9 views

Assignment 2

This document provides instructions for Assignment 2 in Computer Science 231. The assignment is due on February 1, 2008 at noon and is worth 3% of the course grade. It must be submitted in hard copy to the assignment drop box and include your name, student ID, and TA's name. The assignment involves Boolean logic, number systems, and binary conversions. Students are advised against plagiarism and calculators will not be permitted on exams.

Uploaded by

Shoaib Mushtaq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Assignment 2

This document provides instructions for Assignment 2 in Computer Science 231. The assignment is due on February 1, 2008 at noon and is worth 3% of the course grade. It must be submitted in hard copy to the assignment drop box and include your name, student ID, and TA's name. The assignment involves Boolean logic, number systems, and binary conversions. Students are advised against plagiarism and calculators will not be permitted on exams.

Uploaded by

Shoaib Mushtaq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Computer Science 231: Assignment 2 – Number Systems

Due: Friday February 1, 2008 at 12:00 noon.


Weight: 3%

Individual Work:

All assignments in this course are to be completed individually. Students are advised to read the
guidelines for avoiding plagiarism located on the course website.

Late Penalty:

Late assignments will not be accepted.

Submission Instructions:

This assignment must be submitted on paper to the appropriate assignment drop box on the second
floor of math sciences. Please ensure that your name, your student ID number and your TA's name are
legibly written and clearly visible on the front of your submission.

Description:

This assignment provides an opportunity for you to gain additional experience with Boolean logic and
the techniques used to represent numbers within a computer. You are strongly discouraged from
simply using a calculator for the conversions. Similar questions will appear on the midterm and final
exams. Calculators are not permitted for any exams in this course.

1.0 (1 point each) Create truth tables for the following expressions:

(B and (not A)) or A

(A and (not B)) and C

(A and ((not B) or C)) or (B and (not C) and (not A))

1.1 (1 point each) Draw logic gates to represent the expressions from the previous question. Ensure
that you clearly label each input, and the output.

2.0 (1 point each) Convert the following numbers to base 10:

1100 base 2 = ?10


1111 1111 1111 base 2 = ?10
222 201 base 3 = ?10
77 base 8 = ?10
221 base 8 = ?10
0x100 = ?10
0xFACE = ?10
0x2A = ?10
2.1 (1 point each) Convert the following base 10 numbers to the base indicated:

5610 = ?2
5610 = ?3
5610 = ?8
5610 = ?12
5610 = ?16
22110 = ?2
22110 = ?3
22110 = ?8
22110 = ?12
22110 = ?16

2.2 (1 point each) Convert the following numbers to the base indicated:

3312 = ?8
168 = ?2
202103 = ?9
3132334 = ?16
0xF2 = ?8

2.3 (2 points each) Convert 34.34 base 10 to binary, base 3, octal, and hexadecimal. Any fractions
that do not terminate should be truncated to 4 digits in the fractional part.

2.4 (2 points each) Convert 43.2 base 8 to binary, base 3, decimal and hexadecimal. Any fractions
that do not terminate should be truncated to 4 digits in the fractional part.

3.0 (0.5 points each) Consider a computer that represents numbers using a sequence of 23 bits.

• What is the smallest unsigned number that can be represented?


• What is the largest unsigned number that can be represented?
• What is the smallest signed number (most negative) that can be represented using
signed magnitude?
• What is the largest signed number (most positive) that can be represented using signed
magnitude?
• What is the smallest signed number (most negative) that can be represented using one’s
complement?
• What is the largest signed number (most positive) that can be represented using one’s
complement?
• What is the smallest signed number (most negative) that can be represented using two’s
complement?
• What is the largest signed number (most positive) that can be represented using two’s
complement?
4.0 (One point for each row) Represent each of the following base 10 numbers in signed magnitude,
one’s complement and two’s complement. Each of the numbers should be represented in 8 bits.

Base 10 Signed Magnitude One’s Complement Two’s Complement


Binary Representation Binary Representation Binary Representation
43
-43
-128
127
-1

4.1 (One point for each system) List all representations of the base 10 value 0 in signed magnitude,
one’s complement and two’s complement. Express your answer in 8 bits.

5.0 (One point for each sum, 0.5 for each type of overflow for each sum) Perform the following
additions on 8-bit numbers, generating an 8-bit result. Negative numbers are represented using two’s
complement. For each addition, clearly indicate if unsigned and/or signed overflow occurred or not.

1111 1111 0101 0000 1100 1100


1101 0101 1010 1111 1110 1010

1111 1111 0100 1101 0111 1111


1111 1111 0011 0011 1001 1001

Grading:

Half marks are possible on many questions if you show your work. Responses that only include the
answer cannot receive partial credit.

Score out of 69 Letter Grade


69 A+
68 A
66 or 67 A-
64 or 65 B+
62 or 63 B
60 or 61 B-
58 or 59 C+
55 – 57 C
53 or 54 C-
51 or 52 D+
49 or 50 D
47 or 48 D-
46 or less F

You might also like