LogFAQs > #894845160

LurkerFAQs, Active DB, DB1, Database 2 ( 09.16.2017-02.21.2018 ), DB3, DB4, DB5, DB6, DB7, DB8, DB9, DB10, DB11, DB12, Clear
Topic List
Page List: 1
TopicWhat do you think is the most complex invention ever?
DevsBro
01/26/18 12:33:40 PM
#13:


Object-oriented languages have countless features that make programming more flexible, like polymorphism, by which one datatype can qualify as another, inheritance, by which one datatype inherits values from another, dynamic dispatching (which rules) which allows subprograms to be selected based on the datatype of the object passed to them.

Some languages are even interpreted in real-time instead of compiled. This means another program is reading the code and deciding what to do.

Heading back to hardware land, there are countless techniques used to improve the time or space efficiency of computer processors. Using a multicycle datapath will allow instructions that take less time to execute to complete without having to wait for the amount of time it would take a longer instruction before the processor moves on to the next instruction.

Pipelining can improve performance even more by almost achieving one (short) clock cycle per instruction, barring stalls/hazards in the pipeline and the initial fill of the pipeline. The concept is the same as an assembly line. One instruction is being read from memory while the previous is being decoded, while the one before is being executed, while the one before is having its result written to memory.

But pipelining increases the complexity of the processor a lot. What if one instruction needs to read a given register but the previous instruction hasn't finished writing its value? One option is to stall, or wait for the previous function to complete, but that kills your performance. Another option is to exercise out-of-order execution, where you find another instruction that you can do while you wait. This is accomplished via a "scoreboard" that keeps track of which insteuctions need which registers.

Another problem is branching. What do you do if you don't know which instruction to load next? Eager execution says "do both" but that leaves you open to Meltdown and Spectre. Branch prediction says take a guess, but that risks you having to go back when you guess wrong AND leaves you open to Meltdown and Spectre. I'm looking forward to what solutions we will make for these exploits.

There's also superscalar architecture, where you have multiple execution units, which also relies on out-of-order execution.
---
... Copied to Clipboard!
Topic List
Page List: 1