Can we have a computer with just registers as memo

2019-03-25 13:42发布

Registers are the fastest memories in a computer. So if we want to build a computer with just registers and not even caches is it possible? I think of even replacing the magnetic discs with registers although they are naturally volatile memories. Do we have some nonvolatile registers for that use? It would become so fast! I'm just wondering if that could be happen or not?

10条回答
我命由我不由天
2楼-- · 2019-03-25 14:09

The very short answer is yes, you could in theory, but it doesn't really work in real life. Let me explain...

The reason the memory hierarchy exists is because those small and fast memory stores are very expensive per a bit (registers), while the big and slow memory stores are very cheap per a bit (hard drives).

Another reason why huge numbers of registers are highly impractical is because the instructions need to reference the memory location. When you only have a handful of registers, you can store the register (or registers) number and an opcode in a handful of bits, which means that low numbers of registers make for short and fast instructions. If you're going to have a multi-gigabyte collection of registers, you will need to be able to reference them in instructions, and these will be much longer (and therefore slower) instructions. Keep in mind that if everything was a register, some things would be much faster, but by having a smaller number of registers, certain things (i.e., most of what you do with a computer) are much faster.

Having vast numbers of registers would also add a great amount of complexity to the hardware which processes the reading and writing to registers, which would make everything slower.

Of course, while most of us think in terms of computers, there are surely simple devices which do only have registers, but they would also only have a very limited amount of memory, and aren't made for general purpose computation.

You may also be interested to my answer to Assembly: Why are we bothering with registers?

查看更多
smile是对你的礼貌
3楼-- · 2019-03-25 14:11

You don't need even registers - it's possible to create something like Turing machine that takes stream of input code and data and produces output stream. This is something like what computers started with.

查看更多
戒情不戒烟
4楼-- · 2019-03-25 14:11

It is possible, but utterly impractical - even low-end computers today have 2 gigabytes of RAM. How would you handle two billion registers in code (and where would you stuff them, physically)?

Also, what would you do with it, that the speed of RAM (and even processor caches) is a concern? Either run the system off RAM (fast enough), or build a special-purpose processor.

查看更多
欢心
5楼-- · 2019-03-25 14:17

for each register of 32 bit you need at least 9x32 gates of xor. that is a lot of gates.

the bigger problem comes when you want the register data to pass over the bus. which one will hold the bass? you want to add more bass?

lets say we have 10 register, do we do a 10 line bus? meaning we have 10 bus connectors which connects to most of the system? that is a lot of wireing, now you want the register to mean somthing right?

lets just hink how much bass we need for 1kb of data?

1024 bit = 1024*9*32 gates and 1024 bass lines in the cpu.

we know intel is working with 30 nm for one gate. thats 30 million gates , which the gate problem more redandent, but how do you intend to solve the bass problem?

查看更多
登录 后发表回答