Assignment 4 Sample problems

24
Assignment 4 Sample problems

description

Assignment 4 Sample problems. Convert the following decimal numbers to binary. 8 920. Convert the following decimal numbers to binary. 8 =>1000 920 =>1110011000. How can we get ?. 8 => 8*1= 2 3 =>1000 - PowerPoint PPT Presentation

Transcript of Assignment 4 Sample problems

Page 1: Assignment 4  Sample problems

Assignment 4 Sample problems

Page 2: Assignment 4  Sample problems

Convert the following decimal numbers to binary.

8 920

Page 3: Assignment 4  Sample problems

Convert the following decimal numbers to binary.

8 =>1000

920 =>1110011000

Page 4: Assignment 4  Sample problems

How can we get ?

8 => 8*1= 23

=>1000 920 =>512*1+256*1+128*1+16*1+8*1 => 29 +28 +27 +24 +23

=>1110011000

Page 5: Assignment 4  Sample problems

Convert the following Binary numbers to Decimal.

110100

100110011

Page 6: Assignment 4  Sample problems

Convert the following Binary numbers to Decimal.

110100 =>52100110011

=>307

Page 7: Assignment 4  Sample problems

How can we get ?

110100 => 1* 25 +1*24 +1*22

=52 100110011 =>1* 28 +1*25 +1* 24+1* 21+1* 20

= 307

Page 8: Assignment 4  Sample problems

Add the following binary numbers. Express your answers in binary.

101+011=?

11010+10001=?

Page 9: Assignment 4  Sample problems

Add the following binary numbers. Express your answers in binary.

101+011=1000

11010+10001=101011

Page 10: Assignment 4  Sample problems

How can we get ?

101+011 => 1 0 1 + 0 1 1

=> 1 0 0 0 11010+10001 => 1 1 0 1 0 + 1 0 0 0 1 => 1 0 1 0 1 1

Page 11: Assignment 4  Sample problems

Subtract the following binary numbers. Express your answers in binary.

101-001=?

11010-01001=?

Page 12: Assignment 4  Sample problems

Subtract the following binary numbers. Express your answers in binary.

101-001=100

11010-01001=10001

Page 13: Assignment 4  Sample problems

How can we get ?

101-001 => 1 0 1 - 0 0 1

=> 1 0 0 11010-01001 => 1 1 0 1 0 - 0 1 0 0 1 => 1 0 0 0 1

Page 14: Assignment 4  Sample problems

Is this statement True or False? 

If I have an 8-bit system, 10111001 + 00110000 will result in overflow.

Page 15: Assignment 4  Sample problems

Is this statement True or False? 

If I have an 8-bit system, 10111001 + 00110000 will result in overflow.

False

Page 16: Assignment 4  Sample problems

How can we get ?

1. 10111001 + 00110000Þ 10111001+ 00110000Þ 11101001

The result is still 8-bit, so the answer is False

Page 17: Assignment 4  Sample problems

Provide the two's complement of the following 8-bit numbers.

01001110

10010010

Page 18: Assignment 4  Sample problems

Provide the two's complement of the following 8-bit numbers.

01001110 => 10110010

10010010 => 01101110

Page 19: Assignment 4  Sample problems

How can we get ?1: 01001110 => 10110001 (invert bits) + 00000001 (add one) => 101100102: 10010010

=> 01101101 (invert bits) + 00000001 (add one) => 01101110

Page 20: Assignment 4  Sample problems

• Consider the Christmas lights circuit (with states) described in class. Let these be the expressions for the next states.• A: not A• B: A and B

Page 21: Assignment 4  Sample problems

Fill in the table with True or False where appropriate.Time Step (sec)

A B New A New B

0 False False True False

1 True False

2

3

Page 22: Assignment 4  Sample problems

Fill in the table with True or False where appropriate.Time Step (sec)

A B New A New B

0 False False True False

1 True False False False

2 False False True False

3 True False False False

Page 23: Assignment 4  Sample problems

The “period” of a pattern is the number of steps it takes before the pattern repeats. What is the period of this pattern?

Page 24: Assignment 4  Sample problems

The “period” of a pattern is the number of steps it takes before the pattern repeats. What is the period of this pattern?

2