CPSC 121
Lecture 4
January 12, 2009
Menu January 12, 2009
Topics:
Representing Values
Reading:
Today:
Epp 1.5
January 14: Epp 1.3
Reminders:
Labs and tutorials have begun!
Online Quiz 3 deadline 9:00pm January 13
READ
the WebCT Vista course announcements board
Online Quiz 2 (any marks
⇒
full marks)
Online/static Quiz 1 (mark has been waived)
WebCT Vista:
http://www.vista.ubc.ca
www:
http://www.ugrad.cs.ubc.ca/~cs121/
Representing Values
Representing Values
In analog devices, data values are continuous quantities, like electric current or voltage
In digital devices, values are discrete. Each basic data element takes on one of a finite number of distinct values
Modern computers are digital and binary. The basic data element has only two states, representing the binary digits 0
and 1. A binary digit is called a bit
Collections of bits are used to represent numbers, characters, and machine instructions
Collections of bits also are used to represent drawings, images, video and sound
Fixed Width Binary Data
Computer architectures define fixed width binary data pathways
Here, we denote an n bit binary data item whose bits are numbered 0 through
n

1
(from the right). Bit 0 is called the
Least Significant Bit (LSB)
and bit
n

1
is called the
Most Significant Bit (MSB)
0
1
2
n1
LSB
MSB
Typical values for n today are 8, 16, 32, 64 and even 128
Computers manipulate and store data. We now learn more about the internal representation schemes that computers
use for data. Today, we focus on integers. But, we also briefly mention fractions, characters and other data.
We start with positional notation for nonnegative integers (also called natural numbers).
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Positional Notation
Consider the integer 158. The notation “158” is called positional notation in base 10 because the position of each
digit represents multiplication by a specific power of 10. That is, 158 represents:
1
×
10
2
+ 5
×
10
1
+ 8
×
10
0
Consider the binary number 10011110. The notation “10011110” is called positional notation in base 2
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '08
 BELLEVILLE
 Binary numeral system, Positional notation, Decimal, Binary Coded Decimal

Click to edit the document details