Chap2 - Chapter 2 Bits, Data Types & Operations Our first...

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

View Full Document Right Arrow Icon
Chapter 2 Chapter 2 Bits, Data Types & Operations
Background image of page 1

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

View Full DocumentRight Arrow Icon
Data types Data types Our first requirement is to find a way to represent  information (data) in a form that is understood by  both human and machine. We need to represent the following data: Numbers. Text. Image. Videos. We will start by examining different ways of representing  integers and look for a form that suits the computer.
Background image of page 2
Decimal Numbers Decimal Numbers “decimal” means that we have ten  digits to use in  our representation (the symbols  0 through 9) What is 3,546? it is  three  thousands  plus  five  hundreds  plus  four  tens  plus  six  ones . i.e. 3,546 = 3.10 3  + 5.10 2  + 4.10 1  + 6.10 0 How about negative numbers? we use two more symbols  to distinguish positive and negative:     +  and  -
Background image of page 3

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

View Full DocumentRight Arrow Icon
Binary Numbers  Binary Numbers  Devices react to the voltage. We represent the presence of voltage by 1 and  absence of voltage by 0. 0 & 1 is referred as bit – binary digit.
Background image of page 4
Unsigned Binary Integers Unsigned Binary Integers 00000100 00100 100 4 00000011 00011 011 3 00000010 00010 010 2 00000001 00001 001 1 00000000 00000 000 0 8-bits 5-bits 3-bits Y = “abc” = a.2 + b.2 1  + c.2 0 N = number of bits Range is:   i  < 2 N  - 1 (where the digits a, b, c can each take on the values of 0 or 1 only) Problem: How do we represent  negative  numbers?
Background image of page 5

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

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/07/2009 for the course COMPUTER S TA C162 taught by Professor Bits-goa during the Spring '09 term at École Normale Supérieure.

Page1 / 15

Chap2 - Chapter 2 Bits, Data Types & Operations Our first...

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

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