


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



Please take a look at the handput " Number Systems " which has answers to lots of the muddy card
question's from this lecture.
(53 respondents, out of 67students)
Binary is crucial because 0’s and 1’s are the only language that a computer understands. All your high level languages are transformed into machine language (fixed patterns of 0’s and 1’s). We will look at a simple machine language in upcoming lectures.
The representation schemes such as ASCII, Hex, Binary coding, Float-point representations, all provide means of representing numbers as bit patterns.
Good question. There are number of ways (I am sure you can come up with your own scheme) of representing a number in binary representation. There are standardization committees that decide which formats are used and these are agreed upon universally.
It sure does! There is a typo in the figure I coiped from Brookshear (Figure 1.15). 101101 equals 45.
5 ) How do you store values w/ base 10 using ASCII? (1 student)
In ASCII, we represent each symbol by an integer value. For example ‘a’ is using decimal number system = 97 or using hexadecimal number system 61. So the bit pattern to represent ‘a’ = 01100001
If you have only three bits to represent the number, the ‘ 1 ’ is lost (this phenomenon is called overflow).
1’s complement is used. You need to compute the 1’s complement before you can compute the 2’s complement. The handout on number systems has a detailed discussion on the topic.
The algorithm for computing 2’s complement is as follows:
Note that in 2’s complement notation, the bit patterns are unique. There is no possibility of the numbers being represented twice.
The process of converting the number into 2’s complement representation causes the most significant bit to become 1. It is not explicitly set. You do use all the bits to represent a number.
Yes, but it is not explicitly set that way.
Using 8 bits and 2's complement method to represent negative numbers, you can only represent values between 127 and -128? (1 student) Yes
Excess notation, magic number? (18 students)
When using the process defined in Brookshear, there is no loss in precision. Whereas when we do scientific normalization, the 1 can be omitted safely and we gain an extra bit in precision.
When you are representing floating point numbers, you don’t use two’s complement notation at all. You will directly convert the number into the floating point number format using the brookshear algorithm and use the sign bit to represent whether the number was negative or positive.
Good question. When you program yourself, it is critical to take care of both overflow and underflow errors. One of the causes of the Therac-25 accidents was an overflow. The counter would increment the number by 1 every time radiation therapy was performed. When the count reached the maximum number, adding 1 caused it to be reset to zero, dosing the patient with a toxic amount of radiation. You can represent numbers as sequences of bytes. Typically, an integer is 16bits, a single-precision floating-point number is 32 bit and a double-precision floating-point number is 64 bits. The representation of numbers as sequences of bytes, brings up the issue of “endian” representation. (For the roots of why word endian is used, see the handout on number systems).
The computer has no cognitive capabilities – they cannot think on their own. What a computer can do (and very well at that) is do what it is instructed to do – really fast. It cannot understand the nuances of communication that way human beings can. So the quality of your program determines whether the computer performs the operation correctly or not. The ability to think is what makes even the youngest child smarter than a computer.
Please attend recitation, talk to TAs, or let me know if you want more examples than those shown so far.