Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Data Representations and Coding - Homework Assignment 1 | EE 274, Assignments of Electrical and Electronics Engineering

Material Type: Assignment; Class: INTRO TO DIGITAL SYSTEMS; Subject: Electrical Engineering; University: Idaho State University; Term: Fall 2009;

Typology: Assignments

2009/2010

Uploaded on 02/24/2010

koofers-user-dft
koofers-user-dft 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
EE 274 Homework Assignment No. 1 (Data Representations and Coding)
Due: September 21, 2009 before class
Note: Type or neatly show ALL your work in arriving at your answers, i.e. do not just
write down your answers. This assignment requires independent work.
1. What are the 8-bit 2’s-complement and 1s’-complement representations for each of
the following decimal numbers: 25, 120, 82, -42, -6, -111?
Ans: For positive numbers, 2’s-complement and 1s’-complement are the same. On the
other hand, for negative numbers, express the number’s absolute value, flip the bits to get
the 1s’-complement. Then add 1 to the 1s’-complement to get the 2’s-complement.
2. What is the hexadecimal value of the number 1264843010?
Ans: Convert 1264843010 to 1100000011111111111011102 to get C0FFEE16.
3. Add the following pairs of hexadecimal numbers: F35B+27E6, 1B90F+C44E.
Ans: F35B+27E6 = 11B41; 1B90F+C44E = 27D5D. Or convert both addends to base 2,
perform the addition, then convert from base 2 back to base 16.
4. Why is 2’s-complement representation of a number useful in performing a subtraction
between two numbers?
Ans: B1 B2 = B1 + (B2’-1), where (B2’-1) is the 2’s-complement representation of B2.
This way a subtraction is transformed into an addition, i.e. it can be done with an adder.
5. Show, using an n-cube of n=3, how you will come up with an error-correcting code.
How many errors can your code correct? Explain how your code works.
Ans: A code C is t-error correctable iff dm 2t+1. Thus given n=3 your code can correct
at most 1 error. It can detect at most 2 errors, since dm d+1 where d=2 and dm is 3 here.

Partial preview of the text

Download Data Representations and Coding - Homework Assignment 1 | EE 274 and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

EE 274 Homework Assignment No. 1 (Data Representations and Coding) Due: September 21, 2009 before class Note: Type or neatly show ALL your work in arriving at your answers, i.e. do not just write down your answers. This assignment requires independent work.

  1. What are the 8-bit 2’s-complement and 1s’-complement representations for each of the following decimal numbers: 25, 120, 82, - 42, - 6, - 111? Ans: For positive numbers, 2’s-complement and 1s’-complement are the same. On the other hand, for negative numbers, express the number’s absolute value, flip the bits to get the 1s’-complement. Then add 1 to the 1s’-complement to get the 2’s-complement.
  2. What is the hexadecimal value of the number 12648430 10? Ans: Convert 12648430 10 to 1100000011111111111011102 to get C0FFEE 16.
  3. Add the following pairs of hexadecimal numbers: F35B+27E6, 1B90F+C44E. Ans: F35B+27E6 = 11B41; 1B90F+C44E = 27D5D. Or convert both addends to base 2, perform the addition, then convert from base 2 back to base 16.
  4. Why is 2’s-complement representation of a number useful in performing a subtraction between two numbers? Ans: B 1 – B 2 = B 1 + (B 2 ’-1), where (B 2 ’-1) is the 2’s-complement representation of B 2. This way a subtraction is transformed into an addition, i.e. it can be done with an adder.
  5. Show, using an n-cube of n=3, how you will come up with an error-correcting code. How many errors can your code correct? Explain how your code works. Ans: A code C is t - error correctable iff dm ≥ 2 t +1. Thus given n=3 your code can correct at most 1 error. It can detect at most 2 errors, since dm ≥ d +1 where d =2 and dm is 3 here.