CptS260: Introduction to Computer Architecture Assignment 7Processing

这篇具有很好参考价值的文章主要介绍了CptS260: Introduction to Computer Architecture Assignment 7Processing。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

Java Python CptS260: Introduction to Computer Architecture

School of Electrical and Computer Engineering

Assignment 7: Pipelined MIPS Execution on Pipelined a CPU (5%)

Assignment Description

In class we have gone over examples of how a pipelined MIPS CPU will execute instrucitons.

We will assume there is not a delay slot for a branch instruciton. For this assignment you will apply knowledge learned to analyze a program by hand when they are executed by a pipelined MIPS CPU. The code fragment is given below. We will analyze the portion of codes in red only.

# sum the elements of an array of 100 elements

# use an address label instead of fixed address

# initialize the array with 1 to 100 using index

# use addi a negative number for subtraction

# simulate online at - http://www.csbio.unc.edu/mcmillan/miniMIPS.html

# S. L. Lu 1/12/2024

.data

array:

.space 400

.text

main:

addi $t0, $zero, 100             # init index i ($t0 or $8) with 100

la $s0, array                        # load data addr into $s0

init:                                    # initialize array with 100 down to 1

sw $t0, 0($s0)                     # store array[i] into ($s0 or $16)

addi $t0, $t0, -1                   # decrement index by 1

addi $s0, $s0, 4                    # inc addr by 4 since 32b is 4B

bne $t0, $zero, init               # test if i is 0; if not go to init

                                          # start of array_sum, $s0 has array+400

addi $t0, $zero, 100              # reset index to 100

addi $s2, $zero, 0                 # sum = 0 (sum is in $s2 or $18)

loop:                                   # sum array backward

addi $s0, $s0, -4            dai 写CptS260: Introduction to Computer Architecture Assignment 7Processing        # next array element (go backward)

lw $s1, 0($s0)                      # load array[i] in $s1

add $s2, $s2, $s1                 # sum = sum + $s1

addi $t0, $t0, -1                   # decrement index by 1

bne $t0, $zero, loop             # test if index is 0; if not loop

done:                                 # result in $s2 ($18) = 13BA(h) 5050(10))

(1) Assume the 5-stage pipeline machine’s register port cannot support read and write at the same time. Assume there is no implicit bypass forwarding of execution result to register read. Further assume there is only 1 memory unit which does not allow read and write the memory at the same time. What is the average CPI for executing this code segment. (20 pts)

(2) Assume the 5-stage pipeline machine support 2-read ports and 1 write-port. Assume there is no implicit bypass forwarding of execution result to register read. Further assume there is only 1 memory unit which does not allow read and write the memory at the same time. What is the average CPI for executing this code segment. (20 pts)

(3) Assume the 5-stage pipeline machine support 2-read ports and 1 write-port. Assume there is no implicit bypass forwarding of execution result to register read. However, the memory has two ports which allows reading and writing of memory at the same time (or there are instruction cache and data cache). What is the average CPI for executing this code segment. (20 pts)

(4) Assume the 5-stage pipeline machine support 2-read ports and 1 write-port. There is implicit bypass forwarding of execution result to register read and the memory has two ports which allows reading and writing of memory at the same time (or there are instruction cache and data cache). What is the average CPI for executing this code segment. (20 pts)

For each of the above tasks you need to use Microsoft Excel to show the pipeline stages as given in lectures.

(5) Assume the above code is executed on the processor as described in (4) with a 2 GHz clock frequency. What is the execution time in nanoseconds? Is there a way to rewrite the code to improve the overall performance (with less execution time)?  (20 pts)

(6) Turn in your pipeline pictures for each tasks described above together with answers to questions in (5)   Artificial intelligence Java or Java Python C++        WX:codehelp文章来源地址https://www.toymoban.com/news/detail-852764.html

到了这里,关于CptS260: Introduction to Computer Architecture Assignment 7Processing的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • “TypeError: Assignment to constant variable”的问题解决方案

    在使用VUE开发项目时,控制台输出 “TypeError: Assignment to constant variable” 的问题 未捕获的类型错误:赋值给常量变量。 问题代码: 我们使用 const 定义了变量且存在初始值。 后面又给这个变量赋值,所以报错了。 ES6 标准引入了新的 const 来定义常量,const 与 let 都具有

    2024年02月07日
    浏览(40)
  • ❤ TypeError: Assignment to constant variable-Vue3 项目使用

    背景: Vue3 项目使用 TypeError: Assignment to constant variable. 原因: 因为我对const定义的常量重新赋值了 解决方法: 换成 var 声明 当 v-if 与 v-for 一起使用时,v-if 具有比 v-for 更高的优先级。 使用 请确保按照以下步骤检查和修复此问题: 在 script setup 部分使用ref函数来定义响应式

    2024年02月13日
    浏览(31)
  • Introduction to GraphQL-style APIs

    GraphQL is an open-source query language and runtime environment developed by Facebook for constructing APIs. Unlike traditional RESTful APIs, GraphQL allows clients to send precise queries to retrieve the necessary data without returning extraneous information. The core idea of GraphQL is to allow clients to define the data structure they require, rather th

    2024年02月20日
    浏览(39)
  • Introduction to Unit Testing in Java

    作者:禅与计算机程序设计艺术 UNIT TESTING (UNIT测试),是在软件开发生命周期中不可或缺的一环。单元测试是一个模块化的测试工作,它的目标是验证某个函数、模块或者类的某个功能是否符合设计要求。它通过对代码中独立的测试用例进行运行和验证,发现错误并报告给相

    2024年02月08日
    浏览(47)
  • python 入门基础 Introduction to Python Fundamentals

    注释 单行注释 多行注释 pass 补充语法的完整性,什么都不做 字符串格式化 format % f-string(py3.6之后可用) 数据结构 数据类型的转换:目标类型(值),如int(‘1’),将浮点值转换为整型值会丢失精度 在函数中修改全局变量的值需要用 global 再次声明全局变量,以表明修改

    2024年01月16日
    浏览(46)
  • 教程学习:Introduction to Structure Preparation and Visualization

    0、写在开始: 这个教程介绍如何准备配体和蛋白结构,这是建模工程必要的第一步。 教程的组成: 建立项目和导入结构 准备蛋白质结构 准备配体结构 可视化蛋白质-配体复合物 1、建立项目和导入结构: 分子结构可以是pdb格式。导入的结构可以在Entry List栏目中查看,也可

    2024年02月16日
    浏览(47)
  • [ECE] Introduction to Digital Logic and Systems

    This course gives science and engineering students exposure to the basic concepts and techniques in digital logic and system design. Topics include digital system concepts, numbering systems and codes, Boolean algebra, logic gates and logic circuit elements, logic functions and simplification, logic circuits design, latches and flip-flops, counters, register

    2024年01月16日
    浏览(58)
  • Introduction to Natural Language Processing with NLTK

    作者:禅与计算机程序设计艺术 : Natural language processing (NLP) is a subfield of computer science that focuses on the interaction between machines and human languages. It involves building computational models that can understand and manipulate textual data in various ways. The aim of this article is to provide an overview of natural languag

    2024年02月08日
    浏览(45)
  • Introduction to Hadoop Ecosystem for Data Science

    作者:禅与计算机程序设计艺术 Hadoop Ecosystem 是一个基于Java的开源框架,主要用于存储、处理和分析海量数据。其提供的组件包括HDFS(Hadoop Distributed File System),MapReduce(分布式计算框架),YARN(Yet Another Resource Negotiator)以及HBase(一个可伸缩的分布式NoSQL数据库)。 Apa

    2024年02月06日
    浏览(50)
  • 【Golang map并发报错】panic: assignment to entry in nil map

    go并发写 map[string]interface{} 数据的时候,报错: panic: assignment to entry in nil map 多个key同时操作一个map时,如: test[key1] = 1 test[key2] = \\\"a\\\" test[key3] = true 就会遇到并发nil值报错,什么test[key-xxx] = make()根本不行。 用异步sync.Map解决: Lock锁那个比较麻烦,不建议使用。推荐使用sync

    2024年01月19日
    浏览(33)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包