What is the difference between a heap and a stack?

What is the difference between a heap and a stack?

Using this technique, a processor can execute more than one instruction during a clock cycle by simultaneously dispatching multiple instructions to different execution units on the processor.In this model, instructions are always fetched, executed and completed in the order in which they exist in the program.In this mode of execution, if one of the instructions stalls, then all the instructions behind it also stall.The advantage of this model is that if one instruction stalls, then independent instructions behind the stalled instruction can still execute, thereby speeding up the overall execution of program.What is the difference between a conditional branch and unconditional branch instruction?A branch instruction is used to switch program flow from current instruction to a different instruction sequence.A branch instruction can be a conditional branch instruction or an unconditional branch instruction.A branch instruction is called unconditional if the instruction always results in branching.A branch instruction is called conditional if it may or may not cause branching, depending on some condition.If they are not equal, then the instruction sequence will continue in the same order following the branch instruction.What is branch prediction and branch target prediction?A branch target predictor is different and predicts the target of a taken conditional branch or an unconditional branch instruction before the target of the branch instruction is computed by the execution unit of the processor.The advantage being that you don’t need to do decode to know which state you are in.Both Design and Verification Engineers need to possess strong hardware and software skills surrounding the hardware and software interface.Due to these reasons, questions that test a candidate’s understanding of programming basics are part of almost all Verification job interviews.First section consists of questions that test Basic Programming Concepts.Second section consists of questions on Object Oriented Programming, and the third section consists of programming examples specific to most commonly used languages.For better understanding, wherever possible, we have tried to explain the approach required to solve a problem.3.1 Basic Programming ConceptsWhat is the difference between a static and automatic variable, local variable and a global variable in any programming language?There are two separate concepts that distinguish local, auto, static and global variables.The scope of a variable defines where it can be accessed and the storage duration determines how long the variable can be accessed.Local variables have limited scope and are visible only within the block of code in which they are declared.Global variables are accessible anywhere in the program once declared.Static variables have a lifetime that lasts till the end of program and hence are accessible throughout.



loz7885787

7 Blog posts

Comments