青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

posts - 71,  comments - 41,  trackbacks - 0
? 2003 by Charles C. Lin. All rights reserved.

Registers

A basic CPU contains registers, an ALU (to be explained later), busses, and some combinational logic devices like multiplexers (to be explained later).

Registers are basically very fast memory. However, CPUs can only hold a limited number of registers. There are several reasons for it, ranging from how fast a CPU can be with too many registers, to the more important issue of how to specify which register you want to work with.

In the CPU we're building, we'll assume each register can store 32 bits. However, in our examples, we'll use 4 bits, only because it's easier to draw with 4 bits than 32.

Unlike programming languages, registers don't really have a type. Registers can store ASCII characters, memory addresses, signed integers, unsigned integers, etc. A register stores a 32 bit bitstring, and what that bitstring represents depends on the assembly language instructions that manipulate it.

One reason we talked about a clock is because a register is a clocked device. We'll explain more in the next section.

Parallel Load Register

A 4-bit parallel load register is a device with 4 bits of data inputs, one control bit, and 4 bits of output.

Here's a diagram of a parallel load register.

The register is the outer box. It has four bits of data inputs labelled b3..0. It has four bits of output labelled z3..0. It has a single control bit telling the parallel load register what to do. It has a clock input that tells it when to do it.

Inside the parallel load register, we see what appears to be an array. However, unlike the arrays you see in a programming language, the array is numbered from right to left. The rightmost element is indexed 0, while the leftmost box is indexed 3.

In reality, registers don't store "arrays", but to make the explanation easier to understand, just think of it as an array.

The following is a chart indicating how to use the control bit (labeled as c) to tell the parallel load register what to do.

ClockControlOperation
Pos. Edgec = 1Parallel Load (i.e., z3..0 = b3..0)
Pos. Edgec = 0Hold (i.e., z3..0 unchanged)
NOT Pos. Edgec = don't careHold (i.e., z3..0 unchanged)

A parallel load registers has two operations. It can hold. It can parallel load.

  • hold The register keeps the same value in the array. It ignores the input values b3..0.
  • parallel load The register reads in the input values, b3..0, and overwrites the values in the array. Thus, if b3..0 = 0000 and the current value in the register is z3..0 = 0110, then parallel loading the input would cause the register's content to become 0110, and the old values of the register would disappear.

The reason it is called a parallel load is because the bits are loaded in parallel. The other way to load bits is one at a time, i.e., sequentially. This is what happens when you copy an array. It is copied one element at a time.

The control bit, c, is used to tell the register whether to hold or to parallel load. If c = 0, the register holds. If the c = 1, the register parallel loads. However, this is only done when the clock signal is at a positive edge.

If you look at the third row of the chart above, the register also holds its value. When the clock signal is not at a positive edge, the register's value remains the same. It is holding its value.

Remember, It's Continuous

If you think like a programmer, you think discretely. You think of arguments being passed.

However, when you deal with hardware, you need to think continously (and discretely too). In general, the register is always receiving some value for c. Again, think of a pipe being sent into the register.

There's always some red or green soda flowing in. That is, there's always a 0 or 1 being sent to the register using the c control input.

Most of the time, this control input is being ignored. However, when a positive edge occurs, the control input is "read" by the register (to determine which operation to perform), and either a parallel load or hold occurs.

Why Hold?

You might wonder why registers have two operations. In particular, you might wonder why it's necessary to have a "hold" operation. After all, most of the time, the register is holding. Why wouldn't we want to parallel load at each clock edge?

Think of a register as a variable in a programming language. Do we assign to a variable all the time? No. We just assign to the variable when it needs to be assigned. Otherwise, variables would be changing all the time.

We don't always want a register to read the value all the time for the same reason we don't always want a variable to update all the time. Sometimes, we just want to keep the value of the register unchanged.

Here's another analogy. Many years ago, there were milk men who would deliver bottles (yes!) of milk to your house. They would come to your house once a day. However, depending on how fast you drink milk, or whether you're on vacation, you might not want to have milk delivered to you each day.

A system can be worked out between you and the milkman. If you've drunk all the milk, then you can put the empty bottle outside your door. The milkman sees an empty bottle, picks it up, and puts down a new bottle of milk.

On the other hand, if you haven't completed the milk, you don't leave the bottle outside. When the milkman drops by, he doesn't see a bottle of milk outside. So, he doesn't drop a new bottle of milk.

The milkman comes by once a day, which is similar to a positive edge occuring once a period. The milkman has two choices. Drop a new bottle of milk, or don't. If you didn't have this policy, then the milkman would keep dropping off more and more bottles of milk, and it would all go bad. So, there's some justification for not wanting milk to be dropped off each day.

What if you wanted milk to be delievered more often? Like twice a day, instead of once a day? This is analogous to speeding up the clock, and usually we don't have too much control over how fast the clock runs. Generally, you have the clock set at one rate, and that's that.

It's Always Outputting a Value!

Whatever value is in the register, it's continously being output to the outside world. Thus, once you load a parallel load register, z3..0 is set to the value just loaded, and this is sent continuously.

You just have to get used to the idea that a register is always outputting a value. The reason this doesn't cause a problem is because the rest of the CPU doesn't have to actually read the value from the register. Other devices can selectively ignore or read the values of the registers at selected times.

Why Use a Clock?

Why does a register need a clock? Why don't we just update the register whenever we feel like it? The main reason has to do with what registers are used for.

A register outputs a value. This value is needed by other devices in the CPU. For example, we may want to add the value of this register to the value of another register. A device called the ALU can perform this addition.

However, this addition isn't infinitely fast. Even though it's quick, it's not instantaneous. We must wait for the computation to complete. At that point, the result of the computation can be stored. This result is typically store in a register, possibly the same register that produced the value!

So, the clock is primarily used to allow the devices that need to perform computations the time it needs to do so, before updating the registers.

How Does a Register Compare to Memory?

Modern day PCs have clock rates around 3 GHz. This is the rate of the clock on the CPU. In principle, the CPU can execute one instruction per clock cycle. In reality, this happens only if the data is in the registers already.

If you need to access memory (and you'll need to do this), you'll find memory is much, much, much slower to access than registers. Memory is perhaps 400 times as slow to access than registers.

To give you an idea of how much slower that is, suppose someone tells you they are going to come back in a minute. If they come back 400 times as slow, it will take them nearly 7 hours to return.

Clearly, you want to use registers when you can, because they are much faster than memory.

However, there is a problem. CPUs can only hold a limited number of registers. For the CPU we're going to consider, we have 32 32-bit registers. That's 128 bytes.

Typical RAMs on a PC have somewhere between 128 MB up to 1 G. This is at least 100,000 times more memory than registers. However, all that memory comes at a price. It's slow to access.

This is one of the facts about memory. The faster you want memory, the more it costs, and the less of it you can have. To think about why this might occur, let's use an analogy. Think of a city. Suppose it has 100 streets (with traffic lights) going north-south, and 100 streets going east-west. Imagine how long it might take to travel from one corner to the other.

Now imagine that you only have two streets going north-south, and two streets going east-west. It's much faster to travel in this small town, because there are far fewer streets, which you can place quite close together.

Similarly, the more registers you have, the more space it takes up on the CPU, and the more time it takes to access them merely because of the physical space it takes up. When you're trying to run a CPU as fast as possible, these things become important.

Summary

A parallel load register is a sequential device. This means, it uses a clock. Specifically, a parallel load register can only change its value when the clock signal is at a positive edge. When the clock signal is not at a positive edge, the register holds its value.

You can tell a register whether to parallel load or to hold a value by setting the value of c the control bit to 1 or 0, respectively.

However, this bit is only read at the positive clock edge. If you do not have the value of c set to the value you want when the positive edge occurs

(Actually you need to have the value a short time before the edge occurs, and this value must persis to a short time after the edge occurs. The actual amount of time needed depends on the register itself, and is usually part of the technical specifications for the register)

posted on 2007-01-23 14:39 Charles 閱讀(468) 評論(0)  編輯 收藏 引用 所屬分類: 拿來主義
<2007年1月>
31123456
78910111213
14151617181920
21222324252627
28293031123
45678910

決定開始寫工作日記,記錄一下自己的軌跡...

常用鏈接

留言簿(4)

隨筆分類(70)

隨筆檔案(71)

charles推薦訪問

搜索

  •  

積分與排名

  • 積分 - 51542
  • 排名 - 449

最新評論

閱讀排行榜

評論排行榜

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            亚洲国产精品福利| 在线成人av网站| 亚洲一级黄色| 一区二区电影免费在线观看| 欧美精品一区二区三区高清aⅴ| 亚洲精品综合久久中文字幕| 亚洲精品美女在线观看播放| 欧美日韩成人一区二区三区| 亚洲天堂成人在线观看| 亚洲欧美日韩天堂| 怡红院精品视频| 欧美成人综合在线| 欧美日韩精品三区| 久久九九久精品国产免费直播| 欧美专区福利在线| 99热在这里有精品免费| 在线综合亚洲欧美在线视频| 国产综合自拍| 亚洲区免费影片| 国产免费一区二区三区香蕉精| 久久久久国产精品午夜一区| 男人的天堂亚洲在线| 亚洲在线第一页| 久久综合色天天久久综合图片| 亚洲日韩第九十九页| 亚洲影院色无极综合| 在线日韩av片| 亚洲你懂的在线视频| 亚洲高清中文字幕| 亚洲欧美一区二区三区极速播放| 亚洲国产福利在线| 亚洲欧美国产精品桃花| 亚洲精品美女91| 欧美亚洲一区| 亚洲视频专区在线| 久久综合五月| 久久久亚洲高清| 国产精品视频观看| 亚洲精品偷拍| 最新国产成人在线观看| 欧美一区午夜视频在线观看| 亚洲一区区二区| 欧美黄色小视频| 欧美激情一区二区久久久| 国产欧美一区二区精品性色| 亚洲乱码一区二区| 野花国产精品入口| 欧美大片一区二区| 欧美大色视频| 狠狠色丁香婷婷综合| 午夜免费久久久久| 亚洲欧美日韩一区在线| 欧美精品一区在线播放| 亚洲国产成人av| 亚洲国产精品久久久久婷婷老年| 小黄鸭精品密入口导航| 欧美一级视频精品观看| 国产精品视频大全| 午夜视频久久久久久| 欧美一区二区精美| 国产欧美日韩在线观看| 亚洲欧美一区二区原创| 午夜久久美女| 国产欧美一区二区精品仙草咪| 亚洲欧美激情视频| 久久精品二区| 含羞草久久爱69一区| 久久国产精品久久精品国产| 久久视频在线视频| 影音先锋亚洲视频| 美日韩精品视频免费看| 亚洲国产精品久久久久秋霞不卡 | 久久人人九九| 免费不卡视频| 亚洲精品国产拍免费91在线| 欧美精品在线视频| 一区二区三区久久网| 午夜在线电影亚洲一区| 国产一区二区久久| 久久久久久精| 亚洲黄色成人| 午夜欧美大尺度福利影院在线看| 国产日韩精品久久久| 久久精品中文字幕一区| 亚洲国产日韩欧美在线图片| 一本色道久久综合| 国产欧美一区二区精品忘忧草| 久久精品一区| 亚洲精品视频免费| 欧美一区在线视频| 亚洲国产成人午夜在线一区| 欧美日韩欧美一区二区| 欧美在线视频观看免费网站| 欧美成人情趣视频| 亚洲综合第一| 亚洲激情欧美| 国产精品久久久久久久久久免费看| 香蕉久久国产| 亚洲精品视频在线观看网站| 久久久97精品| 一区二区三区欧美| 国产亚洲一区在线| 欧美日本在线视频| 久久精品国产亚洲5555| 日韩一级裸体免费视频| 久久综合久久久久88| 亚洲欧美日韩视频二区| 亚洲国产精品尤物yw在线观看| 国产精品久久久久天堂| 麻豆精品在线视频| 午夜激情一区| 一本色道久久88综合日韩精品| 久久综合久久综合久久综合| 亚洲尤物影院| 99热精品在线| 亚洲国产精品专区久久| 国产自产精品| 国产精品毛片在线| 欧美日韩一区二区三区在线看| 久久免费视频网站| 欧美在线看片| 亚洲男人av电影| 夜夜躁日日躁狠狠久久88av| 亚洲国产日韩精品| 欧美成人官网二区| 久久亚洲不卡| 久久久久在线| 久久精品久久99精品久久| 亚洲图片欧美日产| 亚洲婷婷在线| 亚洲少妇诱惑| 亚洲午夜在线观看| 一本色道久久综合亚洲91| 亚洲精品久久视频| 亚洲精品一区中文| 亚洲另类一区二区| 亚洲精品久久久久中文字幕欢迎你| 亚洲大片在线观看| 在线播放中文一区| 在线观看91精品国产入口| 伊人狠狠色j香婷婷综合| 国产一区欧美日韩| 在线观看日韩av电影| 在线观看亚洲精品| 亚洲欧洲日产国产综合网| 亚洲丰满在线| 日韩亚洲国产欧美| 在线中文字幕日韩| 中文亚洲欧美| 午夜久久美女| 久久亚洲春色中文字幕| 蜜臀av国产精品久久久久| 欧美大尺度在线观看| 91久久久久| 一区二区三区回区在观看免费视频| 在线亚洲一区二区| 欧美一级视频免费在线观看| 久久美女艺术照精彩视频福利播放| 久久一区中文字幕| 欧美日韩国产精品一区| 国产精品videossex久久发布| 国产精品一区一区三区| 一区二区亚洲精品国产| 亚洲精品国产精品乱码不99| 亚洲一区二区在线免费观看视频| 欧美一二三区精品| 麻豆国产精品va在线观看不卡| 亚洲第一狼人社区| 亚洲深夜影院| 久久久久久久久岛国免费| 欧美成人资源| 国产女人精品视频| 最近中文字幕日韩精品 | 国产精品视频内| 红杏aⅴ成人免费视频| 亚洲日本成人女熟在线观看| 亚洲综合电影| 欧美福利视频在线| 亚洲影院色无极综合| 卡一卡二国产精品| 国产精品日韩| 亚洲三级视频| 久久久女女女女999久久| 亚洲精选在线| 久久久久久久综合狠狠综合| 欧美性大战xxxxx久久久| 在线免费不卡视频| 午夜精品短视频| 亚洲日本aⅴ片在线观看香蕉| 西瓜成人精品人成网站| 欧美精品三级日韩久久| 一区二区在线观看av| 性欧美长视频| 亚洲免费成人av电影| 免费欧美在线视频| 黄色免费成人| 久久久久**毛片大全| 亚洲一区二区免费在线| 欧美日本久久| 亚洲精品免费在线观看|