SlideShare a Scribd company logo
1 of 2
Download to read offline
CS520 Computer Architecture Project 2 Spring 2023 Due date: 03/26/2023 1. RULES (1) You
are allowed to work in a group of not more than two students per group, where both members
must have an important role in making sure all members are working together. (2) All groups
must work separately. Cooperation between groups is not allowed. (3) Sharing of code between
groups is considered cheating and will receive appropriate action in accordance with University
policy. The TAs will scan source code through various tools available to us for detecting
cheating. Source code that is flagged by these tools will be dealt with severely. (4) You must do
all your work in C/C++. (5) Your code must be compiled on remote.cs.binghamton.edu or the
machines in the EB-G7 and EB-Q22. This is the platform where the TAs will compile and test
your simulator. They all have the same software environment. 2. Project Description In this
project, you will construct a simple pipeline with an instruction decoder. 3. Pipeline Fetch (IF)
Decode (ID) Instruction Analyze (IA) Memory (Mem2) EX1 Multiplier (Mul) Memory (Mem1)
Writeback (WB) Register Read (RR) Branch (BR) Adder (Add) Register File Divider (Div)
Forwarding Memory Instruction fetch Data load/store Model simple pipeline with the following
three stages. 1 stage for fetch (IF): fetch an instruction from memory 1 stage for decode (ID):
decode an instruction 1 stage for instruction analyze (IA): analyze an instructions dependency 1
stage for register read (RR): access the register file to read registers 1 stage for adder (Add):
Adder operates on the operands if needed 1 stage for multiplier (Mul): Multiplier operates on the
operands if needed 1 stage for divider (Div): Divider operates on the operands if needed 1 stage
for branch (BR): PC is replaced with the branch destination address if needed 2 stages for
memory (Mem1, Mem2): Access memory if needed 1 stage for register writeback (WB): Write
the result into the register file The pipeline supports 4B fixed-length instructions, which have 1B
for opcode, 1B for destination, and 2B for two operands. The destination and the left operand are
always registers. The right operand can be either register or an immediate value. Opcode (1B)
Destination (1B) Left Operand (1B) Right Operand (1B) Opcode (1B) Destination (1B) Operand
(2B) Opcode (1B) None (3B) Instruction: The supported instructions have 14 different types, as
listed in the following table. Note that arithmetic operations, add, sub, mul, and div, now require
at least 1 register operand. The pipeline only supports integer arithmetic operations with 16
integer registers (R0 R15), each is 4B. All numbers between 0 and 1 are discarded (floor). The
load/store instructions read/write 4B from/to the specified address in the memory map file.
Mnemonic Description Destination (1B) Left Operand (1B) Right Operand (1B) Operand (1B)
Immediate value (2B) set set Rx, #Imm (Set an immediate value to register Rx) Register Rx
Immediate value add add Rx, Ry, Rz (Compute Rx = Ry + Rz) Register Rx Register Ry Register
Rz add add Rx, Ry, #Imm (Compute Rx = Ry + an immediate valve) Register Rx Register Ry
Immediate value sub sub Rx, Ry, Rz (Compute Rx = Ry Rz) Register Rx Register Ry Register
Rz sub sub Rx, Ry, #Imm (Compute Rx = Ry - an immediate valve) Register Rx Register Ry
Immediate value mul mul Rx, Ry, Rz (Compute Rx = Ry * Rz) Register Rx Register Ry Register
Rz mul mul Rx, Ry, #Imm (Compute Rx = Ry * an immediate valve) Register Rx Register Ry
Immediate value div div Rx, Ry, Rz (Compute Rx = Ry / Rz) Register Rx Register Ry Register
Rz div div Rx, Ry, #Imm (Compute Rx = Ry / an immediate valve) Register Rx Register Ry
Immediate value ld ld Rx, #Addr (load the data stored in #Addr into register Rx) Register Rx
Immediate value ld ld Rx, Ry (load into register Rx the data stored in the address at Ry) Register
Rx Register Ry st st Rx, #Addr (store the content of register Rx into the address #Addr. E.g.)
Register Rx Immediate value st st Rx, Ry (store the content of register Rx into the address at Ry)
Register Rx Register Ry ret ret (exit the current program) Pipeline: The pipeline has 11 stages.
An instruction is fetched at the IF stage. The instruction is decoded at the ID stage, and its
dependency is analyzed at the IA stage. The necessary registers are read at the RR stage before
the execution stages. After the RR stage, six execution stages follow different instruction types.
The Add stage executes set, add, and sub instructions. The Mul stage executes mul instructions,
and the Div stage executes div instructions. At last, the two Mem stages execute ld instructions.
The loaded data is only available at the end of the second Mem stage (Mem2). Finally,
destination registers are updated at the WB stage. Each stage takes 1 cycle to complete. The
memory unit has two read ports and one write port, supporting all simultaneous read/write
operations in the pipeline without stalls (No structural hazards). Data dependency: The
instructions may exhibit a true dependency. The pipeline solves such a RAW hazard by stalling
the dependent instruction at the RR stage. Note that the register file does not allow the write and
the read operations on the same register in the same clock cycle. Once the waiting register is
updated, the stalled instruction reads the register next cycle. Forwarding: The pipeline supports
forwarding. The result can be forwarded from the Add, Mul, and Div stages at the end of its
cycle. No forwarding is provided from other stages, including the end of the Mem stages. The
stalled instruction can advance to the Add stage when the dependent data is forwarded. Note that
the forwarded data is not stored in this pipeline. When an instruction depends on two
instructions, both instructions must forward the data simultaneously. Memory: The memory map
file contains the snapshot of the system's main memory. The file position 0 to 65535 is mapped
to the main memory address 0 to 65535. The data at the file position presents the data in the
corresponding location of the main memory. Although the programs are in separate files, they
are mapped to the memory address 0 to 999. You do not need to copy the programs to the
memory map file. write sample c code for above

More Related Content

Similar to CS520 Computer Architecture Project 2 � Spring 2023 Due date 0326.pdf

Cs2253 coa-2marks-2013
Cs2253 coa-2marks-2013Cs2253 coa-2marks-2013
Cs2253 coa-2marks-2013Buvana Buvana
 
Computer Organisation and Architecture
Computer Organisation and ArchitectureComputer Organisation and Architecture
Computer Organisation and ArchitectureSubhasis Dash
 
CS150_Project Report
CS150_Project ReportCS150_Project Report
CS150_Project ReportJingwei You
 
Design & Simulation of RISC Processor using Hyper Pipelining Technique
Design & Simulation of RISC Processor using Hyper Pipelining TechniqueDesign & Simulation of RISC Processor using Hyper Pipelining Technique
Design & Simulation of RISC Processor using Hyper Pipelining TechniqueIOSR Journals
 
Module 2 instruction set
Module 2 instruction set Module 2 instruction set
Module 2 instruction set Deepak John
 
Assembly language progarmming
Assembly language progarmmingAssembly language progarmming
Assembly language progarmmingAzmeyer
 
Comparison between RISC architectures: MIPS, ARM and SPARC
Comparison between RISC architectures: MIPS, ARM and SPARCComparison between RISC architectures: MIPS, ARM and SPARC
Comparison between RISC architectures: MIPS, ARM and SPARCApurv Nerlekar
 
Basic_Introduction_to_Microcontroller.ppt
Basic_Introduction_to_Microcontroller.pptBasic_Introduction_to_Microcontroller.ppt
Basic_Introduction_to_Microcontroller.pptSumeyaHussein2
 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)IJERD Editor
 
BCS302-DDCO-basic processing unit-Module 5- VTU 2022 scheme-DDCO-pdf
BCS302-DDCO-basic processing unit-Module 5- VTU 2022 scheme-DDCO-pdfBCS302-DDCO-basic processing unit-Module 5- VTU 2022 scheme-DDCO-pdf
BCS302-DDCO-basic processing unit-Module 5- VTU 2022 scheme-DDCO-pdfciyamala kushbu
 
Assembly programming
Assembly programmingAssembly programming
Assembly programmingOmar Sanchez
 

Similar to CS520 Computer Architecture Project 2 � Spring 2023 Due date 0326.pdf (20)

Cao
CaoCao
Cao
 
Cs2253 coa-2marks-2013
Cs2253 coa-2marks-2013Cs2253 coa-2marks-2013
Cs2253 coa-2marks-2013
 
Computer Organisation and Architecture
Computer Organisation and ArchitectureComputer Organisation and Architecture
Computer Organisation and Architecture
 
CS150_Project Report
CS150_Project ReportCS150_Project Report
CS150_Project Report
 
Design & Simulation of RISC Processor using Hyper Pipelining Technique
Design & Simulation of RISC Processor using Hyper Pipelining TechniqueDesign & Simulation of RISC Processor using Hyper Pipelining Technique
Design & Simulation of RISC Processor using Hyper Pipelining Technique
 
Module 2 instruction set
Module 2 instruction set Module 2 instruction set
Module 2 instruction set
 
CO By Rakesh Roshan
CO By Rakesh RoshanCO By Rakesh Roshan
CO By Rakesh Roshan
 
Instruction codes
Instruction codesInstruction codes
Instruction codes
 
Assignment
AssignmentAssignment
Assignment
 
Assembly language progarmming
Assembly language progarmmingAssembly language progarmming
Assembly language progarmming
 
מצגת פרויקט
מצגת פרויקטמצגת פרויקט
מצגת פרויקט
 
Arm11
Arm11Arm11
Arm11
 
microprocessor
 microprocessor microprocessor
microprocessor
 
Computer Organization
Computer OrganizationComputer Organization
Computer Organization
 
Comparison between RISC architectures: MIPS, ARM and SPARC
Comparison between RISC architectures: MIPS, ARM and SPARCComparison between RISC architectures: MIPS, ARM and SPARC
Comparison between RISC architectures: MIPS, ARM and SPARC
 
Isa bus nptel
Isa bus nptelIsa bus nptel
Isa bus nptel
 
Basic_Introduction_to_Microcontroller.ppt
Basic_Introduction_to_Microcontroller.pptBasic_Introduction_to_Microcontroller.ppt
Basic_Introduction_to_Microcontroller.ppt
 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)
 
BCS302-DDCO-basic processing unit-Module 5- VTU 2022 scheme-DDCO-pdf
BCS302-DDCO-basic processing unit-Module 5- VTU 2022 scheme-DDCO-pdfBCS302-DDCO-basic processing unit-Module 5- VTU 2022 scheme-DDCO-pdf
BCS302-DDCO-basic processing unit-Module 5- VTU 2022 scheme-DDCO-pdf
 
Assembly programming
Assembly programmingAssembly programming
Assembly programming
 

More from ameerandsons

Culturas de mercado A) Empoderar a los empleados para que asuman .pdf
Culturas de mercado A) Empoderar a los empleados para que asuman .pdfCulturas de mercado A) Empoderar a los empleados para que asuman .pdf
Culturas de mercado A) Empoderar a los empleados para que asuman .pdfameerandsons
 
Current Event #2 - summarize a recent business article from a source.pdf
Current Event #2 - summarize a recent business article from a source.pdfCurrent Event #2 - summarize a recent business article from a source.pdf
Current Event #2 - summarize a recent business article from a source.pdfameerandsons
 
cultura y diversidad 1. Paralenguaje se refiere a a. Contacto vi.pdf
cultura y diversidad 1. Paralenguaje se refiere a a. Contacto vi.pdfcultura y diversidad 1. Paralenguaje se refiere a a. Contacto vi.pdf
cultura y diversidad 1. Paralenguaje se refiere a a. Contacto vi.pdfameerandsons
 
Cryptography13.Consider the following matrix with entries from E,.pdf
Cryptography13.Consider the following matrix with entries from E,.pdfCryptography13.Consider the following matrix with entries from E,.pdf
Cryptography13.Consider the following matrix with entries from E,.pdfameerandsons
 
Cuatro tendencias principales que afectan el comercio mundial a prin.pdf
Cuatro tendencias principales que afectan el comercio mundial a prin.pdfCuatro tendencias principales que afectan el comercio mundial a prin.pdf
Cuatro tendencias principales que afectan el comercio mundial a prin.pdfameerandsons
 
Cuando una encuesta mide el compromiso de los empleados de una organ.pdf
Cuando una encuesta mide el compromiso de los empleados de una organ.pdfCuando una encuesta mide el compromiso de los empleados de una organ.pdf
Cuando una encuesta mide el compromiso de los empleados de una organ.pdfameerandsons
 
Cuenta Saldo 31122013 Saldo 31122014 Depreciaci�n acumulada $2.pdf
Cuenta Saldo 31122013 Saldo 31122014 Depreciaci�n acumulada $2.pdfCuenta Saldo 31122013 Saldo 31122014 Depreciaci�n acumulada $2.pdf
Cuenta Saldo 31122013 Saldo 31122014 Depreciaci�n acumulada $2.pdfameerandsons
 
Cuando una empresa instala filiales que producen algunos de los insu.pdf
Cuando una empresa instala filiales que producen algunos de los insu.pdfCuando una empresa instala filiales que producen algunos de los insu.pdf
Cuando una empresa instala filiales que producen algunos de los insu.pdfameerandsons
 
Cuando un proceso no est� bajo control que significa No est� haci.pdf
Cuando un proceso no est� bajo control que significa No est� haci.pdfCuando un proceso no est� bajo control que significa No est� haci.pdf
Cuando un proceso no est� bajo control que significa No est� haci.pdfameerandsons
 
Cuando un proyectil (una roca del espacio, digamos) golpea la superf.pdf
Cuando un proyectil (una roca del espacio, digamos) golpea la superf.pdfCuando un proyectil (una roca del espacio, digamos) golpea la superf.pdf
Cuando un proyectil (una roca del espacio, digamos) golpea la superf.pdfameerandsons
 
Cuando se trata de evaluaciones de desempe�o, los supervisores y los.pdf
Cuando se trata de evaluaciones de desempe�o, los supervisores y los.pdfCuando se trata de evaluaciones de desempe�o, los supervisores y los.pdf
Cuando se trata de evaluaciones de desempe�o, los supervisores y los.pdfameerandsons
 
Cuando los lobos regresaron por primera vez a Yellowstone, las pobla.pdf
Cuando los lobos regresaron por primera vez a Yellowstone, las pobla.pdfCuando los lobos regresaron por primera vez a Yellowstone, las pobla.pdf
Cuando los lobos regresaron por primera vez a Yellowstone, las pobla.pdfameerandsons
 
Cuando Joe maximiza la utilidad, encuentra que su MRS de X por Y (o .pdf
Cuando Joe maximiza la utilidad, encuentra que su MRS de X por Y (o .pdfCuando Joe maximiza la utilidad, encuentra que su MRS de X por Y (o .pdf
Cuando Joe maximiza la utilidad, encuentra que su MRS de X por Y (o .pdfameerandsons
 
Cuando el suministro es de inter�s p�blico Roche y Tamiflu El caso .pdf
Cuando el suministro es de inter�s p�blico Roche y Tamiflu El caso .pdfCuando el suministro es de inter�s p�blico Roche y Tamiflu El caso .pdf
Cuando el suministro es de inter�s p�blico Roche y Tamiflu El caso .pdfameerandsons
 
Cuando escuchas la palabra liderazgo, �qu� te viene a la mente Co.pdf
Cuando escuchas la palabra liderazgo, �qu� te viene a la mente Co.pdfCuando escuchas la palabra liderazgo, �qu� te viene a la mente Co.pdf
Cuando escuchas la palabra liderazgo, �qu� te viene a la mente Co.pdfameerandsons
 
Cuando el fago lambda de tipo salvaje se sembra en placas en un c�sp.pdf
Cuando el fago lambda de tipo salvaje se sembra en placas en un c�sp.pdfCuando el fago lambda de tipo salvaje se sembra en placas en un c�sp.pdf
Cuando el fago lambda de tipo salvaje se sembra en placas en un c�sp.pdfameerandsons
 
Cualquier ayuda es bienvenida. Jayne Butterfield, una madre solter.pdf
Cualquier ayuda es bienvenida. Jayne Butterfield, una madre solter.pdfCualquier ayuda es bienvenida. Jayne Butterfield, una madre solter.pdf
Cualquier ayuda es bienvenida. Jayne Butterfield, una madre solter.pdfameerandsons
 
Cross-cultural industrial and organizational psychology. Citation Tr.pdf
Cross-cultural industrial and organizational psychology. Citation Tr.pdfCross-cultural industrial and organizational psychology. Citation Tr.pdf
Cross-cultural industrial and organizational psychology. Citation Tr.pdfameerandsons
 
Cryptography is designed to turn information into a format that is d.pdf
Cryptography is designed to turn information into a format that is d.pdfCryptography is designed to turn information into a format that is d.pdf
Cryptography is designed to turn information into a format that is d.pdfameerandsons
 
Croce, Incorporated, is investigating an investment in equipment tha.pdf
Croce, Incorporated, is investigating an investment in equipment tha.pdfCroce, Incorporated, is investigating an investment in equipment tha.pdf
Croce, Incorporated, is investigating an investment in equipment tha.pdfameerandsons
 

More from ameerandsons (20)

Culturas de mercado A) Empoderar a los empleados para que asuman .pdf
Culturas de mercado A) Empoderar a los empleados para que asuman .pdfCulturas de mercado A) Empoderar a los empleados para que asuman .pdf
Culturas de mercado A) Empoderar a los empleados para que asuman .pdf
 
Current Event #2 - summarize a recent business article from a source.pdf
Current Event #2 - summarize a recent business article from a source.pdfCurrent Event #2 - summarize a recent business article from a source.pdf
Current Event #2 - summarize a recent business article from a source.pdf
 
cultura y diversidad 1. Paralenguaje se refiere a a. Contacto vi.pdf
cultura y diversidad 1. Paralenguaje se refiere a a. Contacto vi.pdfcultura y diversidad 1. Paralenguaje se refiere a a. Contacto vi.pdf
cultura y diversidad 1. Paralenguaje se refiere a a. Contacto vi.pdf
 
Cryptography13.Consider the following matrix with entries from E,.pdf
Cryptography13.Consider the following matrix with entries from E,.pdfCryptography13.Consider the following matrix with entries from E,.pdf
Cryptography13.Consider the following matrix with entries from E,.pdf
 
Cuatro tendencias principales que afectan el comercio mundial a prin.pdf
Cuatro tendencias principales que afectan el comercio mundial a prin.pdfCuatro tendencias principales que afectan el comercio mundial a prin.pdf
Cuatro tendencias principales que afectan el comercio mundial a prin.pdf
 
Cuando una encuesta mide el compromiso de los empleados de una organ.pdf
Cuando una encuesta mide el compromiso de los empleados de una organ.pdfCuando una encuesta mide el compromiso de los empleados de una organ.pdf
Cuando una encuesta mide el compromiso de los empleados de una organ.pdf
 
Cuenta Saldo 31122013 Saldo 31122014 Depreciaci�n acumulada $2.pdf
Cuenta Saldo 31122013 Saldo 31122014 Depreciaci�n acumulada $2.pdfCuenta Saldo 31122013 Saldo 31122014 Depreciaci�n acumulada $2.pdf
Cuenta Saldo 31122013 Saldo 31122014 Depreciaci�n acumulada $2.pdf
 
Cuando una empresa instala filiales que producen algunos de los insu.pdf
Cuando una empresa instala filiales que producen algunos de los insu.pdfCuando una empresa instala filiales que producen algunos de los insu.pdf
Cuando una empresa instala filiales que producen algunos de los insu.pdf
 
Cuando un proceso no est� bajo control que significa No est� haci.pdf
Cuando un proceso no est� bajo control que significa No est� haci.pdfCuando un proceso no est� bajo control que significa No est� haci.pdf
Cuando un proceso no est� bajo control que significa No est� haci.pdf
 
Cuando un proyectil (una roca del espacio, digamos) golpea la superf.pdf
Cuando un proyectil (una roca del espacio, digamos) golpea la superf.pdfCuando un proyectil (una roca del espacio, digamos) golpea la superf.pdf
Cuando un proyectil (una roca del espacio, digamos) golpea la superf.pdf
 
Cuando se trata de evaluaciones de desempe�o, los supervisores y los.pdf
Cuando se trata de evaluaciones de desempe�o, los supervisores y los.pdfCuando se trata de evaluaciones de desempe�o, los supervisores y los.pdf
Cuando se trata de evaluaciones de desempe�o, los supervisores y los.pdf
 
Cuando los lobos regresaron por primera vez a Yellowstone, las pobla.pdf
Cuando los lobos regresaron por primera vez a Yellowstone, las pobla.pdfCuando los lobos regresaron por primera vez a Yellowstone, las pobla.pdf
Cuando los lobos regresaron por primera vez a Yellowstone, las pobla.pdf
 
Cuando Joe maximiza la utilidad, encuentra que su MRS de X por Y (o .pdf
Cuando Joe maximiza la utilidad, encuentra que su MRS de X por Y (o .pdfCuando Joe maximiza la utilidad, encuentra que su MRS de X por Y (o .pdf
Cuando Joe maximiza la utilidad, encuentra que su MRS de X por Y (o .pdf
 
Cuando el suministro es de inter�s p�blico Roche y Tamiflu El caso .pdf
Cuando el suministro es de inter�s p�blico Roche y Tamiflu El caso .pdfCuando el suministro es de inter�s p�blico Roche y Tamiflu El caso .pdf
Cuando el suministro es de inter�s p�blico Roche y Tamiflu El caso .pdf
 
Cuando escuchas la palabra liderazgo, �qu� te viene a la mente Co.pdf
Cuando escuchas la palabra liderazgo, �qu� te viene a la mente Co.pdfCuando escuchas la palabra liderazgo, �qu� te viene a la mente Co.pdf
Cuando escuchas la palabra liderazgo, �qu� te viene a la mente Co.pdf
 
Cuando el fago lambda de tipo salvaje se sembra en placas en un c�sp.pdf
Cuando el fago lambda de tipo salvaje se sembra en placas en un c�sp.pdfCuando el fago lambda de tipo salvaje se sembra en placas en un c�sp.pdf
Cuando el fago lambda de tipo salvaje se sembra en placas en un c�sp.pdf
 
Cualquier ayuda es bienvenida. Jayne Butterfield, una madre solter.pdf
Cualquier ayuda es bienvenida. Jayne Butterfield, una madre solter.pdfCualquier ayuda es bienvenida. Jayne Butterfield, una madre solter.pdf
Cualquier ayuda es bienvenida. Jayne Butterfield, una madre solter.pdf
 
Cross-cultural industrial and organizational psychology. Citation Tr.pdf
Cross-cultural industrial and organizational psychology. Citation Tr.pdfCross-cultural industrial and organizational psychology. Citation Tr.pdf
Cross-cultural industrial and organizational psychology. Citation Tr.pdf
 
Cryptography is designed to turn information into a format that is d.pdf
Cryptography is designed to turn information into a format that is d.pdfCryptography is designed to turn information into a format that is d.pdf
Cryptography is designed to turn information into a format that is d.pdf
 
Croce, Incorporated, is investigating an investment in equipment tha.pdf
Croce, Incorporated, is investigating an investment in equipment tha.pdfCroce, Incorporated, is investigating an investment in equipment tha.pdf
Croce, Incorporated, is investigating an investment in equipment tha.pdf
 

Recently uploaded

Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 

Recently uploaded (20)

Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 

CS520 Computer Architecture Project 2 � Spring 2023 Due date 0326.pdf

  • 1. CS520 Computer Architecture Project 2 Spring 2023 Due date: 03/26/2023 1. RULES (1) You are allowed to work in a group of not more than two students per group, where both members must have an important role in making sure all members are working together. (2) All groups must work separately. Cooperation between groups is not allowed. (3) Sharing of code between groups is considered cheating and will receive appropriate action in accordance with University policy. The TAs will scan source code through various tools available to us for detecting cheating. Source code that is flagged by these tools will be dealt with severely. (4) You must do all your work in C/C++. (5) Your code must be compiled on remote.cs.binghamton.edu or the machines in the EB-G7 and EB-Q22. This is the platform where the TAs will compile and test your simulator. They all have the same software environment. 2. Project Description In this project, you will construct a simple pipeline with an instruction decoder. 3. Pipeline Fetch (IF) Decode (ID) Instruction Analyze (IA) Memory (Mem2) EX1 Multiplier (Mul) Memory (Mem1) Writeback (WB) Register Read (RR) Branch (BR) Adder (Add) Register File Divider (Div) Forwarding Memory Instruction fetch Data load/store Model simple pipeline with the following three stages. 1 stage for fetch (IF): fetch an instruction from memory 1 stage for decode (ID): decode an instruction 1 stage for instruction analyze (IA): analyze an instructions dependency 1 stage for register read (RR): access the register file to read registers 1 stage for adder (Add): Adder operates on the operands if needed 1 stage for multiplier (Mul): Multiplier operates on the operands if needed 1 stage for divider (Div): Divider operates on the operands if needed 1 stage for branch (BR): PC is replaced with the branch destination address if needed 2 stages for memory (Mem1, Mem2): Access memory if needed 1 stage for register writeback (WB): Write the result into the register file The pipeline supports 4B fixed-length instructions, which have 1B for opcode, 1B for destination, and 2B for two operands. The destination and the left operand are always registers. The right operand can be either register or an immediate value. Opcode (1B) Destination (1B) Left Operand (1B) Right Operand (1B) Opcode (1B) Destination (1B) Operand (2B) Opcode (1B) None (3B) Instruction: The supported instructions have 14 different types, as listed in the following table. Note that arithmetic operations, add, sub, mul, and div, now require at least 1 register operand. The pipeline only supports integer arithmetic operations with 16 integer registers (R0 R15), each is 4B. All numbers between 0 and 1 are discarded (floor). The load/store instructions read/write 4B from/to the specified address in the memory map file. Mnemonic Description Destination (1B) Left Operand (1B) Right Operand (1B) Operand (1B) Immediate value (2B) set set Rx, #Imm (Set an immediate value to register Rx) Register Rx Immediate value add add Rx, Ry, Rz (Compute Rx = Ry + Rz) Register Rx Register Ry Register Rz add add Rx, Ry, #Imm (Compute Rx = Ry + an immediate valve) Register Rx Register Ry Immediate value sub sub Rx, Ry, Rz (Compute Rx = Ry Rz) Register Rx Register Ry Register
  • 2. Rz sub sub Rx, Ry, #Imm (Compute Rx = Ry - an immediate valve) Register Rx Register Ry Immediate value mul mul Rx, Ry, Rz (Compute Rx = Ry * Rz) Register Rx Register Ry Register Rz mul mul Rx, Ry, #Imm (Compute Rx = Ry * an immediate valve) Register Rx Register Ry Immediate value div div Rx, Ry, Rz (Compute Rx = Ry / Rz) Register Rx Register Ry Register Rz div div Rx, Ry, #Imm (Compute Rx = Ry / an immediate valve) Register Rx Register Ry Immediate value ld ld Rx, #Addr (load the data stored in #Addr into register Rx) Register Rx Immediate value ld ld Rx, Ry (load into register Rx the data stored in the address at Ry) Register Rx Register Ry st st Rx, #Addr (store the content of register Rx into the address #Addr. E.g.) Register Rx Immediate value st st Rx, Ry (store the content of register Rx into the address at Ry) Register Rx Register Ry ret ret (exit the current program) Pipeline: The pipeline has 11 stages. An instruction is fetched at the IF stage. The instruction is decoded at the ID stage, and its dependency is analyzed at the IA stage. The necessary registers are read at the RR stage before the execution stages. After the RR stage, six execution stages follow different instruction types. The Add stage executes set, add, and sub instructions. The Mul stage executes mul instructions, and the Div stage executes div instructions. At last, the two Mem stages execute ld instructions. The loaded data is only available at the end of the second Mem stage (Mem2). Finally, destination registers are updated at the WB stage. Each stage takes 1 cycle to complete. The memory unit has two read ports and one write port, supporting all simultaneous read/write operations in the pipeline without stalls (No structural hazards). Data dependency: The instructions may exhibit a true dependency. The pipeline solves such a RAW hazard by stalling the dependent instruction at the RR stage. Note that the register file does not allow the write and the read operations on the same register in the same clock cycle. Once the waiting register is updated, the stalled instruction reads the register next cycle. Forwarding: The pipeline supports forwarding. The result can be forwarded from the Add, Mul, and Div stages at the end of its cycle. No forwarding is provided from other stages, including the end of the Mem stages. The stalled instruction can advance to the Add stage when the dependent data is forwarded. Note that the forwarded data is not stored in this pipeline. When an instruction depends on two instructions, both instructions must forward the data simultaneously. Memory: The memory map file contains the snapshot of the system's main memory. The file position 0 to 65535 is mapped to the main memory address 0 to 65535. The data at the file position presents the data in the corresponding location of the main memory. Although the programs are in separate files, they are mapped to the memory address 0 to 999. You do not need to copy the programs to the memory map file. write sample c code for above