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?
相关问题
- What uses more memory in c++? An 2 ints or 2 funct
- Memory for python.exe on Windows 7 python 32 - Num
- How to make memory allocation in MSVC C++ determin
- java.lang.OutOfMemoryError: GC overhead limit exce
- Memory usage of class instance in c# [duplicate]
相关文章
- Why are memory addresses incremented by 4 in MIPS?
- Is my heap fragmented
- Is there a way to avoid this memory error?
- How do I store a Python object in memory for use b
- Why am I not getting a stack overflow?
- How much memory does a Java object use when all it
- InputMethodManager holds reference to the tabhost
- What is the C++ equivalent of an 'allocated ob
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?
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.
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.
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?