11 views

Uploaded by Timo

Marie Chapter 4 and 5 solutions

Marie Chapter 4 and 5 solutions

© All Rights Reserved

- Datapath Design
- Full New Syllabus
- Slides From TCP/IP - Forouzan
- Fanuc promming and mastering
- RISC Implementation Of Digital IIR Filter in DSP
- Basic Computer Organization-2013 HGS REV
- Structured Text Programming
- FA3
- 030070403 - Microprocessor & Interfacing
- Computer Applications and Management
- 8085 Microprocessor Instruction Set Architecture
- STM UNIT 3
- numpy-ref.pdf
- ch 6 -flow control instructions
- 002 Tutorial Solution
- Chapter2- Machine Instructions and Programs
- 04-Isa
- CS2.Course Outline- Assign Pre Final
- mpi (1)
- ch05

You are on page 1of 7

12.

MARIE can handle 16-bit data, so the AC must be 16 bits wide. However, MARIE's

Memory is limited to 4096 address locations, so the MAR only needs to be 12 bits wide to

Hold the largest address.

13.

1108

3109

9106

3109

2108

7000

3108

9103

0023

14.

A 108

One 109

S1 106

S2 103

15.

a. i) Store 007

ii) Jump 00B

iii) Add 009

b.

If, 100 Load X /Load X

101 Sub One /Subtract 1, store result in AC

102 Skip Cond 800 /If AC>0 (X>1), skip the next instruction

103 Jump End if /Jump to End if if X is not greater than 1

Then, 104 Load X /Reload X so it can be doubled

105 Add X /Double X

106 Store Y /Y:= X + X

107 Clear /Move 0 into AC17.

108 Store X /Set X to 0

Endif,109 Load Y /Load Y into AC

10A Add One /Add 1 to Y

10B Store Y /Y: = Y + 1

10C Halt /Terminate program

X, 10D Dec? /X has starting value, not given in problem

Y, 10E Dec ? /Y has starting value, not given in problem

One, 110 Dec 1 /Use as a constant

16. ORG 100

Load A

Store X /Store A in first parameter

Load B

Store Y /Store B in second parameter

JnS Mul /Jump to multiplication subroutine

Load Sum /Get result

Store E /E:= A x B

Load C

Store X /Store C in first parameter

Load D

Store Y /Store D in second parameter

JnS Mul /Jump to multiplication subroutine

Load Sum /Get result

Store F /F := C x D

Load E /Get first result

Add F /AC now contains sum of A X B + C X D

Halt /Terminate program

A, Dec ? /Initial values of A,B,C,D not given in problem

B, Dec ? / (give values before assembling and running)

C, Dec ? /

D, Dec ? /

X, Dec 0 /First parameter

Y, Dec 0 /Second parameter

Ctr, Dec 0 /Counter for looping

One, Dec 1 /Constant with value 1

E, Dec 0 /Temp storage

F, Dec 0 /Temp storage

Sum, Dec 0

Mul, Hex 0 /Store return address here

Load Y /Load second parameter to be used as counter

Store Ctr /Store as counter

Clear /Clear sum

Store Sum /Zero out the sum to begin

Loop, Load Sum /Load the sum

Add X /Add first parameter

Store Sum /Store result in Sum

Load Ctr

Subt One /Decrement counter

Store Ctr /Store counter

SkipCond 400 /If counter = 0 finish subroutine

Jump Loop /Continue subroutine loop

JumpI Mul /Done with subroutine, return to main

END

17.

Load One

Store X /Initialize X

Loop, Load X /Load loop constant

Subt Ten /Compare X to 10

SkipCond 000 /If AC<0 (X is less than 10), continue loop

Jump Endloop /If X is not less than 10, terminate loop

Load X /Begin body of loop

Add One /Add 1 to X

Store X /Store new value in X

Jump Loop /Continue loop

Endloop, Halt /Terminate program

X, Dec 0 /Storage for X

One, Dec 1 /The constant value 1

Ten, Dec 10 /The loop constant

18.

ORG 100

Load One /Load constant

Store X /Initialize loop control variable X

Loop, Load X /Load X

Subt Ten /Compare X to 10

SkipCond 000 /If AC<0 (X is less than 10), continue loop

Jump Endloop /If X is not less than 10, terminate loop

Load Sum

Add X /Add X to Sum

Store Sum /Store result in Sum

Load X

Add One /Increment X

Store X

Jump Loop

Endloop, Load Sum

Output /Print Sum

Sum, Dec 0

X, Dec 0 /Storage for X

One, Dec 1 /The constant value 1

Ten, Dec 10 /The loop constant

END

19.

ORG 100

Load Y /Load second value to be used as counter

Store Ctr /Store as counter

Loop, Load Sum /Load the sum

Add X /Add X to Sum

Store Sum /Store result in Sum

Load Ctr

Subt One /Decrement counter

Store Ctr /Store counter

SkipCond 400 /If AC=0 (Ctr = 0), discontinue looping

Jump Loop /If AC not 0, continue looping

Endloop, Load Sum

Output /Print product

Halt /Sum contains the product of X and Y

Ctr, Dec 0

X, Dec ? /Initial value of X (could also be input)

Y, Dec ? /Initial value of Y (could also be input)

Sum, Dec 0 /Initial value of Sum

One, Dec 1 /The constant value 1

END

CHAPTER 5 Exercises

1. S

2.

3.

4.

5. S

6. s

EXCERCISES PART 2

1.

a and b.

Address 00 01 10 11

Big Endian 00 00 12 34

Little Endian 34 12 00 00

c. Little endian is more efficient because the additional information simply needs to be

appended. With big endian, the "12" and "34" would need to shift to maintain the

correct byte ordering.

3.

7.

There are 250 2-address instructions. There are only a total of 256 2-address instructions

allowed if we have 32-bit instructions (two addresses take up 24 bits, leaving only 8 bits for

the opcode). Looking at the 8 bit opcode, assume bit patterns 00000000 (0) through

11111001 (249) are used for the 250 two-address instructions. Then there are 6 bit

patterns left for one address instructions. However, each one of these can use the

remaining 12 bits gained from having only one operand, so we have 6 * 212.

8.

a. X Y * W Z * V U * + +

b. W X * W U V * Z + * +

c. W X Y U V * * + * U X Y + * /

9.

a. W * (X + Y - Z)

b. U + (V * (W + (X * (Y + Z))))

c. X + ((Y + Z) * (V - W) + Z)

10.

a. A B - C D E * F - * + G H K * + /

Push A

Push B

Subtract

Push C

Push D

Push E

Mult

Push F

Subtract

Mult

Add

Push G

Push H

Push K

Mult

Add

Div

Pop X

11.

100xxxxxxxx (using 000 through 100 for opcodes). The 1-address instructions could

use 1010000 through 1011111 (16), 1100000 through 1101111 (16), and 1110000

through 1111100 (13 more, for a total of 45). The 0-address instructions could use

11111100000 through 11111101111 (16), and 11111110000 through 11111111111

(16). So we have:

b. Assume the two-address instructions use bit patterns 000 xxxx xxxx through 101 xxxx

xxxx. Assume also that the zero-address instructions are of the format 11111101000

through 11111101111 (8), 11111110000 through 11111110111 (8), and 11111111000

through 11111111111 (8) (These constitute the last 16 binary numbers possible with

11 bits). Then all instructions beginning with 110 (1100000 xxxx through 1101111

xxxx) could be one address instructions (16). In addition, 1110000 xxxx through

1111101 xxxx could be one address instructions, giving us 14 more, for a total of 30 1-

address instructions.

12.

Direct addressing provides the actual memory address of the operand in the instruction,

whereas indirect addressing provides, as part of the instruction, a pointer to a memory

location. For example, the instruction Load X interpreted using direct addressing would go

to memory location X and load the value found there. Using indirect addressing, memory

location X would be used as the effective address of what should actually be loaded. So if a

value of 200 were found at location X, the value located at address 200 would be loaded.

13.

Mode Value

Immediate 1000

Direct 1400

Indirect 1300

Indexed 1000

14.

Mode Value

Immediate 500

Direct 100

Indirect 600

Indexed 800

15.

Max SpeedUp = 5

19.

b. 60 registers imply 6 bits (26 = 64)

c. 256K = 28210 = 218, or 18 bits

d. 32 - (3 + 6 + 18) = 5 bits

- Full New SyllabusUploaded byShChoudhary
- Slides From TCP/IP - ForouzanUploaded byom18sahu
- Fanuc promming and masteringUploaded byajeet200388
- Structured Text ProgrammingUploaded byAndressa Baleeiro
- Datapath DesignUploaded byJian Lastino
- RISC Implementation Of Digital IIR Filter in DSPUploaded byInternational Organization of Scientific Research (IOSR)
- FA3Uploaded byvijithacvijayan
- 8085 Microprocessor Instruction Set ArchitectureUploaded bySangeetha Sangu BC
- Basic Computer Organization-2013 HGS REVUploaded byJason Stephenson
- 030070403 - Microprocessor & InterfacingUploaded bypjenish94
- STM UNIT 3Uploaded byprasanthikasamsetty
- numpy-ref.pdfUploaded byJulian Berrocal Saccatoma
- Computer Applications and ManagementUploaded byParag Paliwal
- ch 6 -flow control instructionsUploaded byapi-237335979
- 002 Tutorial SolutionUploaded byArif Amir
- Chapter2- Machine Instructions and ProgramsUploaded byPushpavalli Kathirvelu
- 04-IsaUploaded byLove Ly
- CS2.Course Outline- Assign Pre FinalUploaded byJean Chel Perez Javier
- mpi (1)Uploaded byTejaswini Teju
- ch05Uploaded byShahzad Zulfiqar
- 2-EndiannessUploaded byAditya Nath Suman
- MIPS-jumps.pdfUploaded bysurajnaik1
- A4-R4Uploaded bySonam Sharma
- Doc1Uploaded bySraVanKuMarThadakamalla
- 8051 Core SpecificationUploaded byAkhila Shamsunder
- caTools.pdfUploaded bysfaritha
- Digital Computer OrganizationUploaded byIndrajeet Kumar
- Spim Lab ManualUploaded byEr Smita Kukreja Insan
- msp430c1111Uploaded byHaks Hax
- Checklist for Code ReviewsUploaded byNoni Nabra

- ICE BPUploaded byTimo
- CV Template 2019Uploaded byTimo
- EMC510S - Elect. Mcs 216 - Test 2 - MemoUploaded byTimo
- FINAL Yearbook 2017 Part 4 Computing and InformaticsUploaded byTimo
- Economic AspectsUploaded byTimo
- System ProtectionUploaded byTimo
- Homework 4 SolutionUploaded byTimo
- Etd820s-Homework Ch 5&6Uploaded byTimo
- ETD 820S HomeworkUploaded byTimo
- SSD_L1Uploaded byTimo
- SSD_UNIT_1Uploaded byShashank Singh
- SSD_L11Uploaded byTimo
- SSD_L10Uploaded byTimo
- SSD_L9Uploaded byTimo
- ETD820S LAB 3 2018Uploaded byTimo
- ETD820S LAB 2 2018Uploaded byTimo
- ETD820S LAB 1 2018Uploaded byTimo
- Java EncapsulationUploaded byTimo
- AC Drives.pdfUploaded byTimo
- AC Drives.pdfUploaded byTimo
- Atm711s Lab 1Uploaded byTimo
- Ch Egg SolutionsUploaded byTimo
- Etd820s Homework 2Uploaded byTimo
- 4 ICN Slides Addressing 2016(1) (1)Uploaded byTimo
- ICN511S Lecture 6Uploaded byTimo
- 2017 Ratio AnalysisUploaded byTimo

- Continuous casting machineUploaded byHeet Patel
- Manual para tuberia de doble contencionUploaded byPedro Rodriguez
- Chapter 1Uploaded byfak22222e
- ASHRAE ANSI IES Final Quantitative Analysis Report 90.1 - 2010 Determination Oct2011_v00Uploaded byronychaves
- SAM in NanotechUploaded byhai904
- Css CourseUploaded bykristoffer
- Electrobisturi AlsaExcell MCDSe -_Service_manualUploaded bymiltonlafebre
- 10..201kkjhkdk61Uploaded byKunal Singh
- BRC 46-38 C Service Manual - Parts List (6)Uploaded bycademore
- 4 Bioreactor ConsiderationsUploaded byTANSIEWYEN
- antennas and types of radarUploaded byapi-273774225
- the role of khulna shipyard on the development of bangladeshUploaded bysamir_805
- TR-200MUploaded byMd Merajul Islam
- 12d Model Course Notes - Basic Road Design.pdfUploaded byZac Francis Daymond
- 1VCP000138-1201Uploaded byzhang1988
- TransTig 1750 Puls.pdfUploaded byDallas Wilson
- 3416 Computer ArchitectureUploaded byMuhammad Qasim
- Types of Shellz TheoryUploaded byDhiraj Dhariwal
- IRIS EngineUploaded byjpalex1986
- Earth Electrodes Section ABB TSC LR WO PNSUploaded byjokots
- Hvac Dwg ListUploaded byWaleed Mohammed Fekry
- 2010_2020 Microplate Absorbance Reader 2020 Sw-Version 2.0 Up Operating Manual Ver 03_10Uploaded byluroguita-1
- S15 Partnership for Progress LTC2013Uploaded bywalaywan
- Mixing TechnologyUploaded bysuraj
- Heat treatment of steel.pdfUploaded bykaviatchennai
- Pressure Pipeline Design Revision S0(15!09!08)Uploaded bysydengineer
- Ficha tecnica octal GP 01.pdfUploaded byEsteban Floreano
- Ajile Development ProcessUploaded bybhowmick
- completion confirmation defineUploaded byMurat Esen
- Reverse-Power.docUploaded byEdward Dinesh