When ever we use any power supply, we must take care of the ratings of the power supply. If the system requires more than what is required then we may face many problems: CASE : When current extracted from the power source is greater than maximum current rating Example1: Suppose we have a battery of voltage […]
Tag: questions
Q: Selection of Power Supply
REQUIREMENTS: Suppose I have the requirement of a power source with very high current rating of 5A and 6V but lighter in weight. Also we can’t have a supply of 220 V to the system. SELECTION: As we can’t have a 220V, hence we can’t design the power supply our self by transforming AC to […]
Frame Pointer
Q- How are variables accessed within a frame in the stack? Ans: Well as there is a pointer known as stack pointer to manage different operations on stack, the same way there is a frame pointer to access different variables with a frame. The stack pointer points to the top of the stack while the […]
Q5: Memory allocation
As address of the variable y is returned and which gets stored in x and the memory block of function abc() is de-allocated. Next we try to store a value in the memory which has been de-allocated. As memory has been de-allocated and hence operating system may have allocated this memory to some other process. […]
Q4: Memory Allocation
What is the output of the following code? (a) 3 (b) 5 (c) Can’t say Ans: Many would answer it as 3 but it is wrong. The way we have tried to do it is wrong. As we enter into main we have a memory allocated for variable x and then function abc is called. Now […]
Q3: Memory allocation
Consider the C code Explain the allocation of memory in stack for the above program. Ans: firstly a frame in stack is created and memory is allocated to store variable x with value 3. And then function call is made to function fun() and a new frame is created in the stack. Firstly return address to […]
Q2: Memory Allocation
Consider the C code: Now we have to picturize the whole scenario in HEAP and STACK memory. Ans: We have no dynamically allocated variables in this program. Hence there is not much role of HEAP memory. We analyze the memory allocation and de-allocation in STACK on next page. We know stack memory is used to […]
Q1: Memory allocation
Now we have the following statements and we see how STACK & HEAP memory is allocated to different variables. We have the empty HEAP memory & STACK memory as: NOTE: For this question we have used a heap memory & allocated space serially while in real, memory is allocated randomly by operating system. char* x; x= […]
Main Memory Design
We generally have a standard memory chip available and we have to inter-connect several chips to obtain the specification of memory required for our system design. Suppose we have the following standard chip available: As it is a chip of 1024 (210) words with each word of 4 bits, so we require 10 address lines […]
Q10: Implement ALU using MUX & ADDER
Q- Implement a basic ALU which performs the operations of logical AND, logical OR, ADD, SUBRACT depending on the values of S1 & S0 Ans: We need to use an ADDER, AND gate, OR gate and some MUXes to implement the above function. We select the functions using the two variables S0 & S1 as: S1 […]