0112-notes - CPSC 121 Lecture 4 January 12, 2009 Menu...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
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! On-line Quiz 3 deadline 9:00pm January 13 READ the WebCT Vista course announcements board On-line Quiz 2 (any marks full marks) On-line/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 n-1 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 non-negative integers (also called natural numbers).
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
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
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/09/2010 for the course CPSC 121 taught by Professor Belleville during the Spring '08 term at The University of British Columbia.

Page1 / 4

0112-notes - CPSC 121 Lecture 4 January 12, 2009 Menu...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online