CS 2630 Computer Organization [PDF]

Instruction set architecture (e.g., MIPS). Compiler. Memory system. I/O system. Processor. Datapath & Control ... St

0 downloads 3 Views 360KB Size

Recommend Stories


PDF Download Computer organization
Love only grows by sharing. You can only have more for yourself by giving it away to others. Brian

[PDF] Computer organization
Don’t grieve. Anything you lose comes round in another form. Rumi

[PDF] Computer Organization and Architecture
If you want to go quickly, go alone. If you want to go far, go together. African proverb

[PDF] Computer Organization and Architecture
I tried to make sense of the Four Books, until love arrived, and it all became a single syllable. Yunus

[PDF] Computer Organization and Architecture
Don't count the days, make the days count. Muhammad Ali

Computer Science (CS)
This being human is a guest house. Every morning is a new arrival. A joy, a depression, a meanness,

COMP2421 Computer Organization
If you are irritated by every rub, how will your mirror be polished? Rumi

[PDF] Download Computer Organization and Architecture
Every block of stone has a statue inside it and it is the task of the sculptor to discover it. Mich

Computer Organization & Assembly Language
Raise your words, not voice. It is rain that grows flowers, not thunder. Rumi

dc107 computer organization
Life isn't about getting and having, it's about giving and being. Kevin Kruse

Idea Transcript


CS 2630 Computer Organization Meeting 5: Stored programs Brandon Myers University of Iowa

Where we are going Compiler

Instruction set architecture (e.g., MIPS) Memory system

Processor Datapath & Control Digital logic

translating source code (C or Java) Programs to assembly language And linking your code to Library code How the software talks To the hardware I/O system How a processor runs MIPS Programs! How switches (1 or 0) can be used to build Interesting functions: from integer arithmetic to programmable computers

Where we are going

Instruction memory

Learn what gets stored in here

Execution engine

Data memory

Peer instruction • MIPS program reading

Storing an instruction as bits • each MIPS instructions is 32 bits, stored in “instruction memory” contents

meaning

address 0000

8e

13

00

00

lw

$s3, 0($s0)

0004

8e

14

00

04

lw

$s4, 4($s0)

0008

02

74

90

20

add

$s2, $s3, $s4

000C

ae

12

00

08

sw

$s2, 8($s0)

0010

22

10

00

04

addi $s0, $s0, 4

0014

22

31

ff

ff

addi $s1, $s1, -1

0018

1e

20

ff

f9

bgtz $s1, loop

Storing an instruction as bits each MIPS instructions is 32 bits, stored in “instruction memory” contents

meaning

address 0000

8e

13

00

00

lw

$s3, 0($s0)

0004

8e

14

00

04

lw

$s4, 4($s0)

0008

02

74

90

20

add

$s2, $s3, $s4

000C

ae

12

00

08

sw

$s2, 8($s0)

0010

22

10

00

04

addi $s0, $s0, 4

0014

22

31

ff

ff

addi $s1, $s1, -1

0018

1e

20

ff

f9

bgtz $s1, loop

R-type

Example:

0x00

8

9

13

0

0x20

000000 01000 01001 01101 00000 100000 0x01096820 MIPS green sheet, P&H

I-type

Example:

0x09

10

14

-1

001001 01010 01110 11111 11111 111111 0x254EFFFF MIPS green sheet, P&H

Peer instruction Give the 32-bit representation of this instruction

a) b) c) d) e)

0x00231025 0x014B4825 0x00430825 0x00611025 0x01695025

More instructions

Instruction execution

Instruction execution PC 00x0000 contents

meaning

address 0000

8e

13

00

00

loop: lw $s3,0($s0)

0004

8e

14

00

04

lw

$s4, 4($s0)

0008

02

74

90

20

add

$s2, $s3, $s4

000C

ae

12

00

08

sw

$s2, 8($s0)

0010

22

10

00

04

addi $s0, $s0, 4

0014

22

31

ff

ff

addi $s1, $s1, -1

0018

1e

20

ff

f9

bgtz $s1, loop

Instruction execution PC 0x0004 contents

meaning

address 0000

8e

13

00

00

loop: lw $s3,0($s0)

0004

8e

14

00

04

lw

$s4, 4($s0)

0008

02

74

90

20

add

$s2, $s3, $s4

000C

ae

12

00

08

sw

$s2, 8($s0)

0010

22

10

00

04

addi $s0, $s0, 4

0014

22

31

ff

ff

addi $s1, $s1, -1

0018

1e

20

ff

f9

bgtz $s1, loop

Instruction execution PC 0x0008 contents

meaning

address 0000

8e

13

00

00

loop: lw $s3,0($s0)

0004

8e

14

00

04

lw

$s4, 4($s0)

0008

02

74

90

20

add

$s2, $s3, $s4

000C

ae

12

00

08

sw

$s2, 8($s0)

0010

22

10

00

04

addi $s0, $s0, 4

0014

22

31

ff

ff

addi $s1, $s1, -1

0018

1e

20

ff

f9

bgtz $s1, loop

Instruction execution PC 0x0018 contents

meaning

address 0000

8e

13

00

00

loop: lw $s3,0($s0)

0004

8e

14

00

04

lw

$s4, 4($s0)

0008

02

74

90

20

add

$s2, $s3, $s4

000C

ae

12

00

08

sw

$s2, 8($s0)

0010

22

10

00

04

addi $s0, $s0, 4

0014

22

31

ff

ff

addi $s1, $s1, -1

0018

1e

20

ff

f9

bgtz $s1, loop

Instruction execution

branches use “relative addressing”

PC 0x0018 contents

meaning

address 0000

8e

13

00

00

loop: lw $s3,0($s0)

0004

8e

14

00

04

lw

$s4, 4($s0)

0008

02

74

90

20

add

$s2, $s3, $s4

000C

ae

12

00

08

sw

$s2, 8($s0)

0010

22

10

00

04

addi $s0, $s0, 4

0014

22

31

ff

ff

addi $s1, $s1, -1

0018

1e

20

ff

f9

bgtz $s1, loop

0xfff9 = -7 0x0018 + 4 + (-7 * 4) = 0x0000

Jumps: absolute addressing

Peer instruction

What is the maximum distance you can jump using a single j? a) b) c) d) e) f)

25 instructions 26 instructions 224 instructions 225 instructions 226 instructions 230 instructions

Administrivia • reminder: HW2 due Thursday 11:59pm • 1. download/run MARS, • 2. watch MARS tutorials lesson 1 and 2 (under ICON > modules) • 3. write the two MIPS programs

• Project 1 out later this week (MIPS programs/assembly) • Debug Your Brain tonight (at the new time 5-6pm CT)

Smile Life

When life gives you a hundred reasons to cry, show life that you have a thousand reasons to smile

Get in touch

© Copyright 2015 - 2024 PDFFOX.COM - All rights reserved.