Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. Problem 2: Bit Twiddling Computers use a particular word size (measured in bits) for representing integers. In the mid-1970s have word sizes of 16

2.

image text in transcribed

Problem 2: Bit Twiddling Computers use a particular word size (measured in bits) for representing integers. In the mid-1970s have word sizes of 16 bits were common A. How many distinct values can be encoded in a 16-bit word? Answer: Even back in those days most computers used a 2's complement representation for integers. In 2's complement notation, one negates a number by complementing each bit in its representation (i.e changing 0's to 1's and vice versa) and adding 1. By convention, we write 2's complement integers with the most-significant bit (MSB) on the left and the least-significant bit (LSB) on the right. Also by convention, if the MSB is 1, the number is negative; otherwise it's non-negative B. Assume a 16-bit 2's complement representation when answering the following questions. What's the binary representation for 0? For the largest positive integer that can be represented? For the most negative integer? What are the decimal equivalent for the largest positive and most negative integers? What do you get if you negate the largest negative integer (give both the binary and decimal values)? Answers 0 (binary) Largest positive (binary) Most negative (binary) Largest positive (decimal) Most negative (decimal) 2's complement of most negative (binary) 2's complement of most negative (decimal) C. Since writing strings of 16 bits gets tedious, it's often convenient to use hexadecimal notation where a single digit in the range 0-9 or A-F is used to represent adjacent groups of 4 bits (starting from the right). Give the corresponding 4-digit hexadecimal encoding for each of the following numbers Answers 1. 2. 3 4 5 6 7. 8 : 2048 : 1023 : 11281 10 :-1073110 :00000100001001002 : -409510 D. At first blush "Complementing each bit and adding 1" doesn't seem like an obvious way to negate a number. However, it should appear "obvious" after the following exercise : Enter 960910 in binary : Complement each bit of the binary number above : Compute the sum of the two numbers : What is the decimal equivalent of this 2's complment sum

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MongoDB Applied Design Patterns Practical Use Cases With The Leading NoSQL Database

Authors: Rick Copeland

1st Edition

1449340040, 978-1449340049

More Books

Students also viewed these Databases questions

Question

what are some examples of conceptual and labour tasks?

Answered: 1 week ago

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago