Information Representation - Computer Systems - Lecture Slides, Slides of Computer Science

These are the Lecture Slides of Computer Systems which includes Writing to Cache, Memory Access, Simple Direct-Mapped Cache, Inconsistent Memory, Write-Through Caches, Write-Back Caches, Finishing Write Back, Write Misses etc.Key important points are: Information Representation, Main Memory, Network Interface, Serial Ports, Processor

Typology: Slides

2012/2013

Uploaded on 03/27/2013

agarkar
agarkar 🇮🇳

4.3

(26)

372 documents

1 / 28

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CSE 410
Computer Systems
Lt 2
I f ti R t ti
L
ec
t
ure
2
I
n
f
orma
ti
on
R
epresen
t
a
ti
on
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c

Partial preview of the text

Download Information Representation - Computer Systems - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

CSE 410Computer Systems

L^

t^

I f

ti^

R

t ti

Lecture 2 – Information Representation

Review: A Computer isReview:

A Computer is …

i

mainmemory

processor

processor/memory bus

I/O bI/O bus

networkinterface

harddisk

video /camera

opticaldrive

serialports

3

interface

disk

camera

drive

ports

BitsBits •^

All memories are composed of (billions of) bits

p^

(^

•^

A bit is:– high or low voltage– 0 or 1– true or false– yes or no– on or offIt’s all how you interpret itIt s all how you interpret it

•^

But to store anything complicated we use a bunch ofbits to make up a number, character, instruction, …

p

5

Computer MemoryComputer

Memory

•^

All memories are organized by grouping sets of bits

g^

y g

p^

g

into individual memory cells

•^

Each cell has an

address

and its

contents

•^

Standard organization now: 1 cell = 8 bits = 1

byte

•^

A single byte can hold

A small integer (0 255 or

– A small integer (0-255 or -128-127)– A single character (‘a’, ‘A’, ‘?’, ‘#’, ‘ ’, …)– A boolean value (00000000 00000001)

A boolean value (00000000, 00000001)

6

Some common storage unitsSome

common storage units

# bits

unit byte

half-word

half wordwordd^

bl

d

double word

•^

Terminology varies: this is how MIPS does it; the Intelx86 calls 16 bits a word & 32 bits a double-word

8

AlignmentAlignment •^

An object in memory is “aligned” when its address is

j^

y^

g

a multiple of its size

•^

Byte: always aligned

•^

Halfword: address is multiple of 2

•^

Word: address is multiple of 4Double word: address is multiple of 8

•^

Double word: address is multiple of 8

•^

Alignment simplifies load/store hardware– And is required by MIPS but not x

And is required by MIPS, but not x

9

Binary Hex and DecimalBinary

, Hex, and Decimal

•^

It’s unwieldy to work with long strings of binary digits,

y^

g^

g^

y^

g^

so we group them in chunks of 4 and treat eachchunk as a digit in base 16H

di it

•^

Hex digits:–

–^

–^

–^

9 = 1001, __ = 1010, __ = 1011

–^

__

, __

, __

, __

•^

Usual notation for hex integer in C, Java, …: 0x1c

11

Hex NumbersHex

Numbers

•^

What is 0x2a5 in decimal?– 0x2a5 = 2

×

2 + a

×

×

= ________________________________

•^

What about 0xbad?

•^

What about 0xbad?_____________________

•^

Be sure you realize that 0x

12

Binary Hex and DecimalBinary

, Hex, and Decimal

01

Binary

2

Hex

16

Binary

Hex0x30x90 A

16

0xA0xF0x

0x1F0x7F0xFF

14

Binary Hex and DecimalBinary

, Hex, and Decimal

Hex

Decimal

Hex

16

Decimal

10

0x

0x

0 A

0xA

0xF

0x

0x1F

0x7F

0xFF

15

Unsigned binary numbersUnsigned

binary numbers

•^

Each bit represents a power of 2

p^

p

•^

For unsigned numbers in a fixed width n-bit field:– 2

n^ distinct values

– the minimum value is 0– the maximum value is 2

n-

, where n is the number

of bits in the fieldof bits in the field

•^

Fixed field widths determine many limits– 5 bits = 32 possible values (

5 bits

32 possible values (

– 10 bits = 1024 possible values (

17

Signed NumbersSigned

Numbers

•^

For unsigned numbers,

g^

– each bit position represents a power of 2– range of values is 0 to 2

n-

•^

How can we indicate negative values?– two states: positive or negative

f

– a binary bit indicates one of two states: 0 or 1 ⇒

use one bit for the sign bit

18

Format of 32

-bit signed integer

Format of 32 bit signed integer sign bit(1 bit)

numeric value(31 bits)

•^

Bit 31 is the sign bit

... –^ 0 for positive numbers, 1 for negative numbers– aka most significant bit (msb), high order bit

20

Example: 4

-bit signed numbers

i^

bi

Hex

Bin

UnsignedDecimal

SignedDecimal

Example:

4 bit signed numbers

sign bit(1 bit)

numeric value

F E D C

numeric

value

(3 bits)

C B A 9 8

21