ECE 4305 Computer Architecture [PDF]

The MIPS source code is given below. Hand assemble these instructions on the given space using the MIPS Reference called

0 downloads 4 Views 155KB Size

Recommend Stories


[PDF] Advanced Computer Architecture
If your life's work can be accomplished in your lifetime, you're not thinking big enough. Wes Jacks

PDF Computer System Architecture
You have to expect things of yourself before you can do them. Michael Jordan

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

[PDF] Advanced Computer Architecture
Goodbyes are only for those who love with their eyes. Because for those who love with heart and soul

[PDF] Advanced Computer Architecture
We can't help everyone, but everyone can help someone. Ronald Reagan

[PDF] Download Advanced Computer Architecture
Never wish them pain. That's not who you are. If they caused you pain, they must have pain inside. Wish

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

ECE 4750 Computer Architecture, Fall 2016 Lab 4
Those who bring sunshine to the lives of others cannot keep it from themselves. J. M. Barrie

[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

Idea Transcript


EE 4305 Computer Architecture Homework #1 The main objective of this homework (HW) is to understand how the MIPS instructions are designed. The best way of learning the instruction set design is to decode or disassemble few instructions. To do this HW, make sure to install the MARS assembler on your computer and verify your machine codes. Its download site is: http://courses.missouristate.edu/kenvollmar/mars/download.htm If your computer does not recognize the downloaded Mars4_5.jar file, it means that you do not have a Java Runtime Environment (JRE) installed. Please do a Google search with a key word, “Java SE downloads”. Click on the icon an appropriate version that matches with your OS and install.

and download

1: Instruction Decoding (Assemble) The MIPS source code is given below. Hand assemble these instructions on the given sheet using the MIPS Reference called “Green Sheet.” Verify the hand-assembled codes using the MARS assembler. Set “Settings/Memory Configuration/Configuration” to “Default” which starts the user code memory (text area) at 0x400000. for1:

slt beq addi slti bne sll add jal addi exit2: lh lui j smap: sh lw sw jr

$t0,$s0,$s3 $t0, $zero, for1 $s1,$s0,-1 $t0,$s1,0 $t0,$s1, exit2 $t1,$s1,2 $t1,$s2,$t1 smap $s1,$s1,-1 $s2, 100($t0) $s2, 200 for1 $s2, 200($t0) $t0,4($t1) $t0,4($t1) $ra

1

Mark the instruction fields, fill in the binary bit patterns, and write in hex. Verify the machine code using MARS. Follow the example shown below.

for1: slt

$t0,$s0,$s3

Address in hex: 400000 Machine code in binary:

Machine code in hex: 0213 402a

…………………………………………………………………………………………….. …………………………………………………………………………………………….. beq

$t0, $zero, for1

Address in hex: 400004 Machine code in binary: 31

27

23

19

15

11

7

3

0

Machine code in hex:

…………………………………………………………………………………………….. addi

$s1,$s0,-1

Address in hex: Machine code in binary: 31

27

23

19

15

11

7

3

0

Machine code in hex:

…………………………………………………………………………………………….. slti

$t0,$s1,0

Address in hex: Machine code in binary: 31

27

23

19

15

11

7

3

0

Machine code in hex:

……………………………………………………………………………………………..

2

bne

$t0,$s1, exit2

Address in hex: Machine code in binary: 31

27

23

19

15

11

7

3

0

Machine code in hex:

…………………………………………………………………………………………….. sll

$t1,$s1,2

Address in hex: Machine code in binary: 31

27

23

19

15

11

7

3

0

Machine code in hex:

…………………………………………………………………………………………….. add

$t1,$s2,$t1

Address in hex: Machine code in binary:

Machine code in hex:

…………………………………………………………………………………………….. jal

smap

Address in hex: Machine code in binary: 31

27

23

19

15

11

7

3

0

Machine code in hex:

……………………………………………………………………………………………..

3

addi

$s1,$s1,-1

Address in hex: Machine code in binary: 31

27

23

19

15

11

7

3

0

Machine code in hex:

…………………………………………………………………………………………….. exit2: lh

$s2, 100($t0)

Address in hex: Machine code in binary: 31

27

23

19

15

11

7

3

0

Machine code in hex:

…………………………………………………………………………………………….. lui

$s2, 200

Address in hex: Machine code in binary: 31

27

23

19

15

11

7

3

0

Machine code in hex:

…………………………………………………………………………………………….. j

for1

Address in hex: Machine code in binary:

Machine code in hex:

……………………………………………………………………………………………..

4

smap: sh

$s2, 200($t0)

Address in hex: Machine code in binary: 31

27

23

19

15

11

7

3

0

Machine code in hex:

…………………………………………………………………………………………….. lw $t0,4($t1) Address in hex: Machine code in binary: 31

27

23

19

15

11

7

3

0

Machine code in hex:

…………………………………………………………………………………………….. sw

$t0,4($t1)

Address in hex: Machine code in binary: 31

27

23

19

15

11

7

3

0

Machine code in hex:

…………………………………………………………………………………………….. jr

$ra

Address in hex: Machine code in binary: 31

27

23

19

15

11

7

3

0

Machine code in hex:

……………………………………………………………………………………………..

5

2: Disassemble the given machine code to an assembly code MIPS machine code: 0x3c1101f4 Binary: 31

27

23

19

15

11

7

3

0

Assembly instruction: ……………………………………………………………………………………………..

MIPS machine code: 0x02538822 Binary: 31

27

23

19

15

11

7

3

0

Assembly instruction: …………………………………………………………………………………………….. MIPS machine code: 0x08100011 Binary: 31

27

23

19

15

11

7

3

0

Instruction: Since the corresponding label is not provided, show it in the form of direct address, i.e., j 0x########. Assume that the current PC is at 0x400200, and show the address using a 32-bit byte address in hex.) ……………………………………………………………………………………………..

Print this form, fill in by hand, check and correct your translation using MARS assembler, add your name at the top of the first page, then submit.

6

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.