Simple Instructions Exemple

Simple_Instructions_Exemple

Simple_Instructions_Exemple

Simple_Instructions_Exemple

User Manual: Pdf

Open the PDF directly: View PDF PDF.
Page Count: 2

DownloadSimple Instructions Exemple
Open PDF In BrowserView PDF
EXAMPLE 1
Instruction Memory’s file: 5th_fig421_MemEx1/inst.rom
The user should set initial register values (linear). No data values are required.
Description: A simple sequence of five “add” instructions with no hazards.
ADD r1,r1,r2
ADD r3,r0,r2
ADD r4,r0,r2
ADD r5,r0,r2
ADD r6,r0,r2
ADD r1,r1,r2 – type R instruction
opcode = 0 rs = 1 rt = 2 rd = 1
000000
00001 00010 00001
0x00220820

sh = 0 func = 32
00000 100000

ADD r3,r0,r2 – type R instruction
opcode = 0 rs = 0 rt = 2 rd = 3
000000
00000 00010 00011
0x00021820

sh = 0 func = 32
00000 100000

ADD r4,r0,r2 – type R instruction
opcode = 0 rs = 0 rt = 2 rd = 4
000000
00000 00010 00100
0x00022020

sh = 0 func = 32
00000 100000

ADD r5,r0,r2 – type R instruction
opcode = 0 rs = 0 rt = 2 rd = 5
000000
00000 00010 00101
0x00022820

sh = 0 func = 32
00000 100000

ADD r6,r0,r2 – type R instruction
opcode = 0 rs = 0 rt = 2 rd = 6
000000
00000 00010 00110
0x00023020

sh = 0 func = 32
00000 100000

The hexadecimal code example is:
ADD r1,r1,r2 – 0x00220820
ADD r3,r0,r2 – 0x00021820
ADD r4,r0,r2 – 0x00022020
ADD r5,r0,r2 – 0x00022820
ADD r6,r0,r2 – 0x00023020

Calculations check (with linear initial register values):
ADD r1,r1,r2 – r1 = 3
ADD r3,r0,r2 – r3 = 2
ADD r4,r0,r2 – r4 = 2
ADD r5,r0,r2 – r5 = 2
ADD r6,r0,r2 – r6 = 2



Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.4
Linearized                      : No
Page Count                      : 2
Language                        : en-US
Author                          : Chris Gull
Creator                         : Writer
Producer                        : LibreOffice 5.1
Create Date                     : 2016:05:23 20:28:02-03:00
EXIF Metadata provided by EXIF.tools

Navigation menu