简体   繁体   English

冯·诺伊曼与哈佛建筑

[英]von neumann vs harvard architecture

Why computer architecture based on von Neumann architecture is preferred over Harvard architecture, when designing personal computers; 在设计个人计算机时,为什么基于冯·诺依曼架构的计算机体系结构优于哈佛体系结构; while Harvard architecture is used for designing microcomputer based computer systems and DSP based computer systems? 哈佛架构用于设计基于微机的计算机系统和基于DSP的计算机系统?

Well current CPU designs for PC's have both Harvard and Von Neumann elements ( more Von Neumann though ). 目前用于PC的CPU设计同时具有Harvard和Von Neumann元素( 尽管Von Neumann更多 )。

If you look at the L1 caches you would see that in AMD, ARM and Intel systems you have Instruction L1 Cache and Data L1 Cache, that can be accessed independently and in parallel. 如果你看看L1缓存,你会发现在AMD,ARM和Intel系统中你有指令L1缓存和数据L1缓存,可以独立和并行访问。 That's the Harvard part . 那是哈佛的一部分 However, in L2, L3 or in DRAM, data and codes are mixed. 但是,在L2,L3或DRAM中,数据和代码是混合的。 That's the Von Neumann part . 那是冯·诺依曼的一部分

So why isn't a pure Harvard architecture adopted for PC's? 那么为什么PC不采用纯粹的哈佛架构呢? My opinion is that it does not make sense. 我的意见是它没有意义。 If you profile main majority of applications, you would see that the L1 Instruction Cache miss ratio is very small . 如果您对大多数应用程序进行概要分析,您会发现L1指令高速缓存未命中率非常小 This means that generally code size is not a problem. 这意味着通常代码大小不是问题。 So it wouldn't make sense to design a fully separate path for code. 因此,为代码设计完全独立的路径是没有意义的。 Data can grow very large but code can't really. 数据可能会变得非常大,但代码却无法实现。

In DSP's it makes sense to use separate code and data paths. 在DSP中,使用单独的代码和数据路径是有意义的。 That's because DSP's work mainly on "streaming data" meaning that the need for caching is rather small. 这是因为DSP的主要工作是“流数据”,这意味着对缓存的需求相当小。 Also the DSP codes can contain pre-computed coefficients that increase the code size. 此外,DSP代码可以包含增加代码大小的预先计算的系数。 So there is a balance between data size and code size, meaning that it makes sense using a Harvard architecture. 因此,数据大小和代码大小之间存在平衡,这意味着使用哈佛架构是有意义的。

The fundamental difference between Von Neumann architecture and Harvard architecture is that while in the Harvard architecture, instruction memory is distinct from data memory, in Von Neumann they are the same. Von Neumann架构与哈佛架构的根本区别在于,在哈佛架构中,指令存储器与数据存储器不同,在Von Neumann中它们是相同的。 This reflects the practical reality of PCs (in which programs are stored and read from the same medium as data, usually disk and RAM), and microcontrollers (in which the program is stored in non-volatile memory, and data is stored in volatile memory). 这反映了PC的实际现实(其中程序存储和读取与数据相同的介质,通常是磁盘和RAM),以及微控制器(其中程序存储在非易失性存储器中,数据存储在易失性存储器中) )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM