Baby Steps

We’re going to take the first step in “building” the CPU. We’re going to introduce two registers: the MAR and the MDR. We assume both are 32-bit parallel load registers.

MAR

MAR is short for memory address register. This register has its output hooked up to the address bus. This register is going to be the only way for the CPU to communicate with the bus.

However, to prevent the memory address register from continously dumping its output to the address bus, we’ll place a 32-bit tri-state buffer between the output of the MAR and the address bus. This allows other devices (say, I/O devices) to use the address bus, if necessary.

The MAR can hold two different kinds of addresses. Either it stores the address of an instruction, or it stores the address of data. Of course, as far as memory is concerned, an address is an address. It doesn’t care what is stored at that address.

However, from your perspective, as a person learning how a CPU works, it’s useful to know that MAR can hold either an instruction address or a data address.

Where does the MAR load its addresses? For now, we’re just going to say that it comes from some other part of the CPU, which we’ll discuss at a later point.

MDR

MDR is short for memory data register. As you might guess, the MDR is the analog of the MAR, except it is used with the data bus, instead of the address bus. Unlike the MAR, where we either place the address on the address bus or we don’t (by deactivating the tri-state buffer between the MAR and the address bus), the MDR has more operations than just placing the data on the data bus or not placing it.

In particular, data can go both ways. For a load operation, we expect to read data from the data bus into the MDR. For a store operation, we expect to place the data from the MDR onto the data bus.

This means that the MDR can (parallel) load its data from one of two places: the data bus (for a load operation) and somewhere else in the CPU (for a store operation).

We want to provide two choices for where the MDR should get its data. What kind of circuit should we use that allows us to select from one of two different inputs? A 2-1 MUX! Specifically, a 32-bit 2-1 MUX.

Similarly, the data from the MDR can either go to the data bus (for a store operation) or to some other part of the the CPU (for a load operation). Although it looks like we may need a DeMUX, we won’t. We’ll just split the data up, and both places will get the data.

A Diagram

This is how the diagram of the CPU looks so far.

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-C5jlBduV-1615299745288)(https://web.archive.org/web/20170328171842im_/http://www.cs.umd.edu/class/sum2003/cmsc311/Notes/Overall/Figs/Mar/cpu1.png)]

So far, the CPU contains two registers. MAR is on the left. MDR is on the right. The input to the MAR comes from some other place in the CPU, which we’ll discuss later on.

The output of the MAR is hooked to the address bus using a 32-bit tri-state buffer.

The inputs to the MDR comes from one of two places. Either it comes from some other place in the CPU (for store operations) or it comes from the data bus (for load operations). A MUX is used to pick which input the MDR should load from.

The output of the MDR is hooked to the data bus using a 32-bit tri-state buffer. It is also directed to some other place in the CPU, which presumably uses the data in the MDR after it has been loaded from the data bus.

The diagram may seem confusing, but you should look it over until you feel comfortable with what’s going on.

I’ve left of the drawing of memory, which would be hooked up to the address and data bus, as shown from a previous set of notes (see the initial Roadmap notes). However, you should assume that memory is still there.

Control Signals

We have two registers, one MUX, and two tri-state buffers. Each of these devices has control inputs that tell it what to do. Each of them have a letter written beside it.

Let’s list them out.

  • A

    This is the control to the 32-bit 2-1 MUX to the MDR. Either the MDR can get its input from the data bus or from some other part of the CPU to be specified later on.

  • B

    This is the control to the MAR. You can either load or hold.

  • C

    This is the control to the MDR. You can either load or hold.

  • D

    This is the control to the tri-state buffer from the MAR to the address bus. The control can either be on (allowing the bits to flow through) or off (allowing nothing to flow through).

  • E This is the control to the tri-state buffer from the MDR to the data bus. The control can either be on (allowing the bits to flow through) or off (allowing nothing to flow through).

The control signals are going to become very important soon because they will allow use to control when the CPU does what. In particular, we’re eventually going to talk about the design of a control unit, which will orchestrate the events in a CPU.

We’re going to classify control signals into two types:

  • Operations on registers (i.e., parallel load and hold)
  • Operations on combinational logic devices (e.g.,. MUXes, tri-state buffers)

The biggest difference between these two kinds of signals is that one is based on a clock (i.e., sequential devices such as registers) and the other one is not (i.e., combinational logic devices).

Even though the second one is not based on a clock, the entire CPU runs using a clock, and so, indirectly, the clock is important when it comes to dealing with combinational logic devices.

We’ll discuss these issues in a future set of notes.

Hidden Registers

The MAR and MDR are considered “hidden registers”. These are registers that are not used directly by the assembly language programmer. They are used to implement the instructions, however.

Think of them like local variables to a function. For example, you may have been assigned to write a function that takes two parameters and returns some value. To compute the return value, you may need to declare some local variables. Whoever uses the function does not have to be aware of the local variables, and that they are used to help with the function.

Similarly, users do not need to be aware of the MAR and the MDR. Over time, we may decide it’s not necessary to have the MAR or the MDR. Because they are hidden, it shouldn’t affect the running of the assembly language programs, since they don’t use these registers.

Summary

The MAR and MDR are two hidden registers. They are the “gateway” to the address and data bus respectively. They are the only connection to the busses.

We use tri-state buffers and a MUX to control where the data comes from and where the data goes to with these two registers.

Later on, we’ll fill in those details, as we extend our implementation of the CPU.

MAR与MDR是什么?相关推荐

  1. 转载 MAR、MDR以及ROM、RAM的区别和联系

    转载地址 MAR和MDR MAR 和 MDR MAR(Memory Address Register) 存储器地址寄存器 MDR(Memory Date Register) 存储器数据寄存器 区别: ...

  2. alu和mdr位数相等吗_计算机组成原理复习

    概论 冯诺依曼体系 冯·诺依曼结构的特点是: 计算机硬件系统由五大部件(存储器.运算器.控制器.输入设备和输出设备)组成:计算机中采用二进制形式表示信息:采用存储程序的工作方式 . 冯诺依曼思想包含三 ...

  3. MAR在计算机组成原理上是啥,计算机组成原理复习材料(2)

    14152计算机组成原理考试题型 一.填空题(每空1分,共10分) 二.单项选择题(每题2分,共30分) 三.多项选择题(每题2分,共10分) 四.简答题(每题5分,共10分) 五.计算题(每题10分 ...

  4. alu和mdr位数相等吗_计算机组成原理课后答案 -

    PC+1→PC AC-BUS→Z Z→BUS→AC 取 指 周 期 执 行 周 期 PCo,MARi MARo,MDRi MDRo,IRi +1 ACo,Yi Ho,ALUi ACo, - ,Zi Z ...

  5. 唐朔飞计算机组成原理pdf_唐朔飞计算机组成原理第2版配套题库名校考研真题课后答案资料课后习题章节题库模拟试题...

    唐朔飞<计算机组成原理>(第2版)配套题库[名校考研真题+课后习题+章节题库+模拟试题] 第一部分 名校考研真题 2015年全国硕士研究生入学统一考试计算机科学与技术学科联考计算机学科专业 ...

  6. 北师大计算机网络原理和应用作业,北师大网络作业计算机组成原理 作业一(可编辑)...

    <计算机组成原理>作业(一) 学完1-2章后可以完成作业(一).作业总分100分,将作为平时成绩记入课程总成绩. 一.解释下列英文缩写的中文含义(包括英文全称.中文名.功能三部分):(每题 ...

  7. 计算机组成原理学习笔记(一)

    一 1.计算机的软件分为两大类:系统软件和应用软件. 2.汇编语言:用符号ADD,SUB,MUL,DIV等分别表示加.减.乘.除等操作,并用符号表示指令或数据所在存储空间的地址. 3.翻译程序有两种: ...

  8. 【408预推免复习】计算机组成原理之计算机系统概论

    文章目录 1 计算机系统简介 2 计算机的基本组成 3 计算机硬件的主要技术指标 1 计算机系统简介 2 计算机的基本组成 冯·诺依曼计算机的特点 计算机由五大部件组成 指令和数据以同等地位存于存储器 ...

  9. 计算机组成原理(哈工大刘宏伟)135讲(一)

    第一章 计算机系统概论 1.1 计算机系统简介 计算机的软硬件概念 1.2 计算机的基本组成 冯诺伊曼计算机的特点 1.计算机由五大部件组成 2.指令和数据以同等地位存于存储器,可按地址寻访 3.指令 ...

最新文章

  1. win8.1升级到win10后 vmware不能连网的问题
  2. Python之并发编程
  3. This Jenkins instance appears to be offline
  4. lua c语言混合编程入门
  5. 《大话设计模式》6个原则 转帖
  6. P2579,jzoj2288-[ZJOI2005]沼泽鳄鱼【矩阵乘法】
  7. 华为路由器A1如何设置虚拟服务器,华为路由器A1如何设置虚拟服务器
  8. HybridPose:混合表示下的6D对象姿态估计
  9. 学习笔记--爬虫(11)---js逆向思路和解密思路(初级)
  10. python运势预测程序_运势.py · Scar/Python-Spider - Gitee.com
  11. 程序员过中秋 | 如何用代码绘制月亮?
  12. 邮件营销怎么做你知道吗?电子邮件营销平台注册流程
  13. RTX2080Ti和RTX2080 Super 那个好
  14. java secretkey用法_Java SecretKeyFactory.generateSecret方法代码示例
  15. 每天一个新知识之Linux的LVM逻辑卷管理
  16. 谷歌离线地图的使用(1)
  17. 从零玩转jQuery之项目开发(QQ音乐播放器)
  18. 【1024】写给最好的你-程序员
  19. 任意凸四边形内最大矩形
  20. 索尼的hlg是什么_索尼HLG的拍摄使用方法

热门文章

  1. 三种canvas星空背景效果
  2. unity 图片格式一键修改
  3. 第012天:Material Design界面设计语言
  4. 国际网络领域会议:ACM SIGCOMM
  5. iOS证书可以删除吗,到期怎么更新
  6. 圣经学习网站 ////英文学习网站
  7. 一文看懂中国的运营商入库认证(中国电信入库指南)
  8. Linux常用命令练习题-shell脚本用法(3)
  9. moment.js中时间处理的常用方法
  10. 实时语音驱动实现Android端Avatar虚拟人表情表达