Qureshi University, Advanced courses, via cutting edge technology, News, Breaking News | Latest News And Media | Current News
admin@qureshiuniversity.com

Admissions | Accreditation | Booksellers | Catalog | Colleges | Contact Us | Continents/States/Districts | Contracts | Distance Education | Emergency | Examinations | Forms | Grants | Hostels | Honorary Doctorate degree | Investment | Instructors | Lecture | Librarians | Membership | Professional Examinations | Programs | Progress Report | Recommendations | Research Grants | Researchers | Students login | School | Search | Seminar | Study Center/Centre | Sponsorship | Tutoring | Thesis | Universities | Work counseling

Microprocessor
Origins
Embedded applications
Structure
8-bit designs
12-bit designs
16-bit designs
32-bit designs
64-bit designs in personal computers
Integrated circuit
Have you ever wondered how chips such as microprocessors, video processors, memories, chipsets etc are created and manufactured?
How Microprocessors Work

­The computer you are using to read this page uses a microprocessor to do its work. The microprocessor is the heart of any normal computer, whether it is a desktop machine, a server or a laptop. The microprocessor you are using might be a Pentium, a K6, a PowerPC, a Sparc or any of the many other brands and types of microprocessors, but they all do approximately the same thing in approximately the same way.

A microprocessor -- also known as a CPU or central processing unit -- is a complete computation engine that is fabricated on a single chip. The first microprocessor was the Intel 4004, introduced in 1971. The 4004 was not very powerful -- all it could do was add and subtract, and it could only do that 4 bits at a time. But it was amazing that everything was on one chip. Prior to the 4004, engineers built computers either from collections of chips or from discrete components (transistors wired one at a time). The 4004 powered one of the first portable electronic calculators.

­ If you have ever wondered what the microprocessor in your computer is doing, or if you have ever wondered about the differences between types of microprocessors, then read on. In this article, you will learn how fairly simple digital logic techniques allow a computer to do its job, whether its playing a game or spell checking a document!

The first microprocessor to make it into a home computer was the Intel 8080, a complete 8-bit computer on one chip, introduced in 1974. The first microprocessor to make a real splash in the market was the Intel 8088, introduced in 1979 and incorporated into the IBM PC (which first appeared around 1982). If you are familiar with the PC market and its history, you know that the PC market moved from the 8088 to the 80286 to the 80386 to the 80486 to the Pentium to the Pentium II to the Pentium III to the Pentium 4. All of these microprocessors are made by Intel and all of them are improvements on the basic design of the 8088. The Pentium 4 can execute any piece of code that ran on the original 8088, but it does it about 5,000 times faster!

The following table helps you to understand the differences between the different processors that Intel has introduced over the years.

The date is the year that the processor was first introduced. Many processors are re-introduced at higher clock speeds for many years after the original release date.

Transistors is the number of transistors on the chip. You can see that the number of transistors on a single chip has risen steadily over the years.

Microns is the width, in microns, of the smallest wire on the chip. For comparison, a human hair is 100 microns thick. As the feature size on the chip goes down, the number of transistors rises.

Clock speed is the maximum rate that the chip can be clocked at. Clock speed will make more sense in the next section. # Data Width is the width of the ALU. An 8-bit ALU can add/subtract/multiply/etc. two 8-bit numbers, while a 32-bit ALU can manipulate 32-bit numbers. An 8-bit ALU would have to execute four instructions to add two 32-bit numbers, while a 32-bit ALU can do it in one instruction. In many cases, the external data bus is the same width as the ALU, but not always. The 8088 had a 16-bit ALU and an 8-bit bus, while the modern Pentiums fetch data 64 bits at a time for their 32-bit ALUs.

MIPS stands for "millions of instructions per second" and is a rough measure of the performance of a CPU. Modern CPUs can do so many different things that MIPS ratings lose a lot of their meaning, but you can get a general sense of the relative power of the CPUs from this column.

Name
Date
Transistors
Microns
Clock speed
Data width
MIPS
8080
1974
6,000
6
2 MHz
8 bits
0.64
8088
1979
29,000
3
5 MHz
16 bits
8-bit bus
0.33
80286
1982
134,000
1.5
6 MHz
16 bits
1
80386
1985
275,000
1.5
16 MHz
32 bits
5
80486
1989
1,200,000
1
25 MHz
32 bits
20
Pentium
1993
3,100,000
0.8
60 MHz
32 bits
64-bit bus
100
Pentium II
1997
7,500,000
0.35
233 MHz
32 bits
64-bit bus
~300
Pentium III
1999
9,500,000
0.25
450 MHz
32 bits
64-bit bus
~510
Pentium 4
2000
42,000,000
0.18
1.5 GHz
32 bits
64-bit bus
~1,700
Pentium 4 "Prescott"
2004
125,000,000
0.09
3.6 GHz
32 bits
64-bit bus
~7,000
Microprocessor Logic

To understand how a microprocessor works, it is helpful to look inside and learn about the logic used to create one. In the process you can also learn about assembly language -- the native language of a microprocessor -- and many of the things that engineers can do to boost the speed of a processor.

A microprocessor executes a collection of machine instructions that tell the processor what to do. Based on the instructions, a microprocessor does three basic things:

* Using its ALU (Arithmetic/Logic Unit), a microprocessor can perform mathematical operations like addition, subtraction, multiplication and division. Modern microprocessors contain complete floating point processors that can perform extremely sophisticated operations on large floating point numbers.

* A microprocessor can move data from one memory location to another.

* A microprocessor can make decisions and jump to a new set of instructions based on those decisions.

There may be very sophisticated things that a microprocessor does, but those are its three basic activities. The following diagram shows an extremely simple microprocessor capable of doing those three things:

This is about as simple as a microprocessor gets. This microprocessor has:

* An address bus (that may be 8, 16 or 32 bits wide) that sends an address to memory

* A data bus (that may be 8, 16 or 32 bits wide) that can send data to memory or receive data from memory

* An RD (read) and WR (write) line to tell the memory whether it wants to set or get the addressed location

* A clock line that lets a clock pulse sequence the processor

* A reset line that resets the program counter to zero (or whatever) and restarts execution

Let's assume that both the address and data buses are 8 bits wide in this example.

Here are the components of this simple microprocessor:

* Registers A, B and C are simply latches made out of flip-flops. (See the section on "edge-triggered latches" in How Boolean Logic Works for details.)
* The address latch is just like registers A, B and C.
* The program counter is a latch with the extra ability to increment by 1 when told to do so, and also to reset to zero when told to do so.
* The ALU could be as simple as an 8-bit adder (see the section on adders in How Boolean Logic Works for details), or it might be able to add, subtract, multiply and divide 8-bit values. Let's assume the latter here.
* The test register is a special latch that can hold values from comparisons performed in the ALU. An ALU can normally compare two numbers and determine if they are equal, if one is greater than the other, etc. The test register can also normally hold a carry bit from the last stage of the adder. It stores these values in flip-flops and then the instruction decoder can use the values to make decisions.
* There are six boxes marked "3-State" in the diagram.
These are tri-state buffers. A tri-state buffer can pass a 1, a 0 or it can essentially disconnect its output (imagine a switch that totally disconnects the output line from the wire that the output is heading toward). A tri-state buffer allows multiple outputs to connect to a wire, but only one of them to actually drive a 1 or a 0 onto the line.
* The instruction register and instruction decoder are responsible for controlling all of the other components.

Although they are not shown in this diagram, there would be control lines from the instruction decoder that would:

* Tell the A register to latch the value currently on the data bus

* Tell the B register to latch the value currently on the data bus

* Tell the C register to latch the value currently output by the ALU

* Tell the program counter register to latch the value currently on the data bus

* Tell the address register to latch the value currently on the data bus

* Tell the instruction register to latch the value currently on the data bus

* Tell the program counter to increment

* Tell the program counter to reset to zero

* Activate any of the six tri-state buffers (six separate lines)

* Tell the ALU what operation to perform

* Tell the test register to latch the ALU's test bits

* Activate the RD line

* Activate the WR line

Coming into the instruction decoder are the bits from the test register and the clock line, as well as the bits from the instruction register.

Microprocessor Memory


ROM chip

RAM chip
Microprocessor memory helps with the microprocessors basic functions. Learn about microprocessor memory, ROM, BIOS and what the boot sector is.

ROM chip

The previous section talked about the address and data buses, as well as the RD and WR lines. These buses and lines connect either to RAM or ROM -- generally both. In our sample microprocessor, we have an address bus 8 bits wide and a data bus 8 bits wide. That means that the microprocessor can address (28) 256 bytes of memory, and it can read or write 8 bits of the memory at a time. Let's assume that this simple microprocessor has 128 bytes of ROM starting at address 0 and 128 bytes of RAM starting at address 128.

ROM stands for read-only memory. A ROM chip is programmed with a permanent collection of pre-set bytes. The address bus tells the ROM chip which byte to get and place on the data bus. When the RD line changes state, the ROM chip presents the selected byte onto the data bus.

Microprocessor memory helps with the microprocessors basic functions. Learn about microprocessor memory, ROM, BIOS and what the boot sector is.

RAM chip

RAM stands for random-access memory. RAM contains bytes of information, and the microprocessor can read or write to those bytes depending on whether the RD or WR line is signaled. One problem with today's RAM chips is that they forget everything once the power goes off. That is why the computer needs ROM.

By the way, nearly all computers contain some amount of ROM (it is possible to create a simple computer that contains no RAM -- many microcontrollers do this by placing a handful of RAM bytes on the processor chip itself -- but generally impossible to create one that contains no ROM). On a PC, the ROM is called the BIOS (Basic Input/Output System). When the microprocessor starts, it begins executing instructions it finds in the BIOS. The BIOS instructions do things like test the hardware in the machine, and then it goes to the hard disk to fetch the boot sector (see How Hard Disks Work for details). This boot sector is another small program, and the BIOS stores it in RAM after reading it off the disk. The microprocessor then begins executing the boot sector's instructions from RAM. The boot sector program will tell the microprocessor to fetch something else from the hard disk into RAM, which the microprocessor then executes, and so on. This is how the microprocessor loads and executes the entire operating system.

Microprocessor Instructions

Even the incredibly simple microprocessor shown in the previous example will have a fairly large set of instructions that it can perform. The collection of instructions is implemented as bit patterns, each one of which has a different meaning when loaded into the instruction register. Humans are not particularly good at remembering bit patterns, so a set of short words are defined to represent the different bit patterns. This collection of words is called the assembly language of the processor. An assembler can translate the words into their bit patterns very easily, and then the output of the assembler is placed in memory for the microprocessor to execute.

Here's the set of assembly language instructions that the designer might create for the simple microprocessor in our example:

* LOADA mem - Load register A from memory address
* LOADB mem - Load register B from memory address
* CONB con - Load a constant value into register B
* SAVEB mem - Save register B to memory address
* SAVEC mem - Save register C to memory address
* ADD - Add A and B and store the result in C
* SUB - Subtract A and B and store the result in C
* MUL - Multiply A and B and store the result in C
* DIV - Divide A and B and store the result in C
* COM - Compare A and B and store the result in test
* JUMP addr - Jump to an address
* JEQ addr - Jump, if equal, to address
* JNEQ addr - Jump, if not equal, to address
* JG addr - Jump, if greater than, to address
* JGE addr - Jump, if greater than or equal, to address
* JL addr - Jump, if less than, to address
* JLE addr - Jump, if less than or equal, to address
* STOP - Stop execution

If you have read How C Programming Works, then you know that this simple piece of C code will calculate the factorial of 5 (where the factorial of 5 = 5! = 5 * 4 * 3 * 2 * 1 = 120):

a=1;
f=1;
while (a <= 5)
{
f = f * a;
a = a + 1;
}

At the end of the program's execution, the variable f contains the factorial of 5.

Assembly Language

A C compiler translates this C code into assembly language. Assuming that RAM starts at address 128 in this processor, and ROM (which contains the assembly language program) starts at address 0, then for our simple microprocessor the assembly language might look like this:

// Assume a is at address 128
// Assume F is at address 129
0 CONB 1 // a=1;
1 SAVEB 128
2 CONB 1 // f=1;
3 SAVEB 129
4 LOADA 128 // if a > 5 the jump to 17
5 CONB 5
6 COM
7 JG 17
8 LOADA 129 // f=f*a;
9 LOADB 128
10 MUL
11 SAVEC 129
12 LOADA 128 // a=a+1;
13 CONB 1
14 ADD
15 SAVEC 128
16 JUMP 4 // loop back to if
17 STOP

ROM

So now the question is, "How do all of these instructions look in ROM?" Each of these assembly language instructions must be represented by a binary number. For the sake of simplicity, let's assume each assembly language instruction is given a unique number, like this:

* LOADA - 1
* LOADB - 2
* CONB - 3
* SAVEB - 4
* SAVEC mem - 5
* ADD - 6
* SUB - 7
* MUL - 8
* DIV - 9
* COM - 10
* JUMP addr - 11
* JEQ addr - 12
* JNEQ addr - 13
* JG addr - 14
* JGE addr - 15
* JL addr - 16
* JLE addr - 17
* STOP - 18

The numbers are known as opcodes. In ROM, our little program would look like this:

// Assume a is at address 128

// Assume F is at address 129
Addr opcode/value
0 3 // CONB 1
1 1
2 4 // SAVEB 128
3 128
4 3 // CONB 1
5 1
6 4 // SAVEB 129
7 129
8 1 // LOADA 128
9 128
10 3 // CONB 5
11 5
12 10 // COM
13 14 // JG 17
14 31
15 1 // LOADA 129
16 129
17 2 // LOADB 128
18 128
19 8 // MUL
20 5 // SAVEC 129
21 129
22 1 // LOADA 128
23 128
24 3 // CONB 1
25 1
26 6 // ADD
27 5 // SAVEC 128
28 128
29 11 // JUMP 4
30 8
31 18 // STOP

You can see that seven lines of C code became 18 lines of assembly language, and that became 32 bytes in ROM.

Decoding

The instruction decoder needs to turn each of the opcodes into a set of signals that drive the different components inside the microprocessor. Let's take the ADD instruction as an example and look at what it needs to do:

1. During the first clock cycle, we need to actually load the instruction. Therefore the instruction decoder needs to:
* activate the tri-state buffer for the program counter
* activate the RD line
* activate the data-in tri-state buffer
* latch the instruction into the instruction register

2. During the second clock cycle, the ADD instruction is decoded. It needs to do very little:
* set the operation of the ALU to addition
* latch the output of the ALU into the C register

3. During the third clock cycle, the program counter is incremented (in theory this could be overlapped into the second clock cycle).

Every instruction can be broken down as a set of sequenced operations like these that manipulate the components of the microprocessor in the proper order. Some instructions, like this ADD instruction, might take two or three clock cycles. Others might take five or six clock cycles.

Microprocessor Performance and Trends

The number of transistors available has a huge effect on the performance of a processor. As seen earlier, a typical instruction in a processor like an 8088 took 15 clock cycles to execute. Because of the design of the multiplier, it took approximately 80 cycles just to do one 16-bit multiplication on the 8088. With more transistors, much more powerful multipliers capable of single-cycle speeds become possible.

More transistors also allow for a technology called pipelining. In a pipelined architecture, instruction execution overlaps. So even though it might take five clock cycles to execute each instruction, there can be five instructions in various stages of execution simultaneously. That way it looks like one instruction completes every clock cycle.

Many modern processors have multiple instruction decoders, each with its own pipeline. This allows for multiple instruction streams, which means that more than one instruction can complete during each clock cycle. This technique can be quite complex to implement, so it takes lots of transistors.

Trends

The trend in processor design has primarily been toward full 32-bit ALUs with fast floating point processors built in and pipelined execution with multiple instruction streams. The newest thing in processor design is 64-bit ALUs, and people are expected to have these processors in their home PCs in the next decade. There has also been a tendency toward special instructions (like the MMX instructions) that make certain operations particularly efficient, and the addition of hardware virtual memory support and L1 caching on the processor chip. All of these trends push up the transistor count, leading to the multi-million transistor powerhouses available today. These processors can execute about one billion instructions per second!

64-bit Microprocessors

64 bit processors have entered the mainstream. Find out how 64 bit processors work and why they can handle an almost infinite amount of RAM.

Photo courtesy AMD

Sixty-four-bit processors have been with us since 1992, and in the 21st century they have started to become mainstream. Both Intel and AMD have introduced 64-bit chips, and the Mac G5 sports a 64-bit processor. Sixty-four-bit processors have 64-bit ALUs, 64-bit registers, 64-bit buses and so on.

One reason why the world needs 64-bit processors is because of their enlarged address spaces. Thirty-two-bit chips are often constrained to a maximum of 2 GB or 4 GB of RAM access. That sounds like a lot, given that most home computers currently use only 256 MB to 512 MB of RAM. However, a 4-GB limit can be a severe problem for server machines and machines running large databases. And even home machines will start bumping up against the 2 GB or 4 GB limit pretty soon if current trends continue. A 64-bit chip has none of these constraints because a 64-bit RAM address space is essentially infinite for the foreseeable future -- 2^64 bytes of RAM is something on the order of a billion gigabytes of RAM.

With a 64-bit address bus and wide, high-speed data buses on the motherboard, 64-bit machines also offer faster I/O (input/output) speeds to things like hard disk drives and video cards. These features can greatly increase system performance.

Servers can definitely benefit from 64 bits, but what about normal users? Beyond the RAM solution, it is not clear that a 64-bit chip offers "normal users" any real, tangible benefits at the moment. They can process data (very complex data features lots of real numbers) faster. People doing video editing and people doing photographic editing on very large images benefit from this kind of computing power. High-end games will also benefit, once they are re-coded to take advantage of 64-bit features. But the average user who is reading e-mail, browsing the Web and editing Word documents is not really using the processor in that way.

x86 interview questions

These interview questions test the knowledge of x86 Intel architecture and 8086 microprocessor specifically.

1. What is a Microprocessor? - Microprocessor is a program-controlled device, which fetches the instructions from memory, decodes and executes the instructions. Most Micro Processor are single- chip devices.
2. Give examples for 8 / 16 / 32 bit Microprocessor? - 8-bit Processor - 8085 / Z80 / 6800; 16-bit Processor - 8086 / 68000 / Z8000; 32-bit Processor - 80386 / 80486.
3. Why 8085 processor is called an 8 bit processor? - Because 8085 processor has 8 bit ALU (Arithmetic Logic Review). Similarly 8086 processor has 16 bit ALU.
4. What is 1st / 2nd / 3rd / 4th generation processor? - The processor made of PMOS / NMOS / HMOS / HCMOS technology is called 1st / 2nd / 3rd / 4th generation processor, and it is made up of 4 / 8 / 16 / 32 bits.
5. Define HCMOS? - High-density n- type Complimentary Metal Oxide Silicon field effect transistor.
6. What does microprocessor speed depend on? - The processing speed depends on DATA BUS WIDTH.
7. Is the address bus unidirectional? - The address bus is unidirectional because the address information is always given by the Micro Processor to address a memory location of an input / output devices.
8. Is the data bus is Bi-directional? - The data bus is Bi-directional because the same bus is used for transfer of data between Micro Processor and memory or input / output devices in both the direction.
9. What is the disadvantage of microprocessor? - It has limitations on the size of data. Most Microprocessor does not support floating-point operations.
10. What is the difference between microprocessor and microcontroller? - In Microprocessor more op-codes, few bit handling instructions. But in Microcontroller: fewer op-codes, more bit handling Instructions, and also it is defined as a device that includes micro processor, memory, & input / output signal lines on a single chip.
11. What is meant by LATCH? - Latch is a D- type flip-flop used as a temporary storage device controlled by a timing signal, which can store 0 or 1. The primary function of a Latch is data storage. It is used in output devices such as LED, to hold the data for display.
12. Why does microprocessor contain ROM chips? - Microprocessor contain ROM chip because it contain instructions to execute data.
13. What is the difference between primary & secondary storage device? - In primary storage device the storage capacity is limited. It has a volatile memory. In secondary storage device the storage capacity is larger. It is a nonvolatile memory. Primary devices are: RAM / ROM. Secondary devices are: Floppy disc / Hard disk.
14. Difference between static and dynamic RAM? - Static RAM: No refreshing, 6 to 8 MOS transistors are required to form one memory cell, Information stored as voltage level in a flip flop. Dynamic RAM: Refreshed periodically, 3 to 4 transistors are required to form one memory cell, Information is stored as a charge in the gate to substrate capacitance.
15. What is interrupt? - Interrupt is a signal send by external device to the processor so as to request the processor to perform a particular work.
16. What is cache memory? - Cache memory is a small high-speed memory. It is used for temporary storage of data & information between the main memory and the CPU (center processing unit). The cache memory is only in RAM.
17. What is called .Scratch pad of computer.? - Cache Memory is scratch pad of computer.
18. Which transistor is used in each cell of EPROM? - Floating .gate Avalanche Injection MOS (FAMOS) transistor is used in each cell of EPROM.
19. Differentiate between RAM and ROM? - RAM: Read / Write memory, High Speed, Volatile Memory. ROM: Read only memory, Low Speed, Non Voliate Memory.
20. What is a compiler? - Compiler is used to translate the high-level language program into machine code at a time. It doesn.t require special instruction to store in a memory, it stores automatically. The Execution time is less compared to Interpreter.
21. Which processor structure is pipelined? - All x86 processors have pipelined structure.
22. What is flag? - Flag is a flip-flop used to store the information about the status of a processor and the status of the instruction executed most recently
23. What is stack? - Stack is a portion of RAM used for saving the content of Program Counter and general purpose registers.
24. Can ROM be used as stack? - ROM cannot be used as stack because it is not possible to write to ROM.
25. What is NV-RAM? - Nonvolatile Read Write Memory, also called Flash memory. It is also know as shadow RAM.

Intel interview questions

The following questions are used for screening the candidates during the first interview. The questions apply mostly to fresh college grads pursuing an engineering career at Intel.

1. Have you studied buses? What types?
2. Have you studied pipelining? List the 5 stages of a 5 stage pipeline. Assuming 1 clock per stage, what is the latency of an instruction in a 5 stage machine? What is the throughput of this machine?
3. How many bit combinations are there in a byte?
4. For a single computer processor computer system, what is the purpose of a processor cache and describe its operation?
5. Explain the operation considering a two processor computer system with a cache for each processor.
6. What are the main issues associated with multiprocessor caches and how might you solve them?
7. Explain the difference between write through and write back cache.
8. Are you familiar with the term MESI?
9. Are you familiar with the term snooping?
10. Describe a finite state machine that will detect three consecutive coin tosses (of one coin) that results in heads.
11. In what cases do you need to double clock a signal before presenting it to a synchronous state machine?
12. You have a driver that drives a long signal & connects to an input device. At the input device there is either overshoot, undershoot or signal threshold violations, what can be done to correct this problem?
13. What are the total number of lines written by you in C/C++? What is the most complicated/valuable program written in C/C++?
14. What compiler was used?
15. What is the difference between = and == in C?
16. Are you familiar with VHDL and/or Verilog?
17. What types of CMOS memories have you designed? What were their size? Speed?
18. What work have you done on full chip Clock and Power distribution? What process technology and budgets were used?
19. What types of I/O have you designed? What were their size? Speed? Configuration? Voltage requirements?
20. Process technology? What package was used and how did you model the package/system? What parasitic effects were considered?
21. What types of high speed CMOS circuits have you designed?
22. What transistor level design tools are you proficient with? What types of designs were they used on?
23. What products have you designed which have entered high volume production?
24. What was your role in the silicon evaluation/product ramp? What tools did you use?
25. If not into production, how far did you follow the design and why did not you see it into production?

Embedded systems interview questions

1. Can structures be passed to the functions by value?
2. Why cannot arrays be passed by values to functions?
3. Advantages and disadvantages of using macro and inline functions?
4. What happens when recursion functions are declared inline?
5. Scope of static variables?
6. Difference between object oriented and object based languages?
7. Multiple inheritance - objects contain howmany multiply inherited ancestor?
8. What are the 4 different types of inheritance relationship?
9. How would you find out the no of instance of a class?
10. Is java a pure object oriented language? Why?
11. Order of constructor and destructor call in case of multiple inheritance?
12. Can u have inline virtual functions in a class?
13. When you inherit a class using private keyword which members of base class are visible to the derived class?
14. What is the output of printf("\nab\bcd\ref"); -> ef 15. #define cat(x,y) x##y concatenates x to y. But cat(cat(1,2),3) does not expand but gives preprocessor warning. Why?
16. Can you have constant volatile variable? Yes, you can have a volatile pointer?
17. ++*ip increments what? it increments what ip points to
18. Operations involving unsigned and signed — unsigned will be converted to signed
19. a+++b -> (a++)+b
20. malloc(sizeof(0)) will return — valid pointer
21. main() {fork();fork();fork();printf("hello world"); } — will print 8 times.
22. Array of pts to functions — void (*fptr[10])()
23. Which way of writing infinite loops is more efficient than others? there are 3ways.
24. # error — what it does?
25. How is function itoa() written?
26. Who to know wether systemuses big endian or little endian format and how to convert among them?
27. What is interrupt latency?
28. What is forward reference w.r.t. pointers in c?
29. How is generic list manipulation function written which accepts elements of any kind?
30. What is the difference between hard real-time and soft real-time OS?
31. What is interrupt latency? How can you recuce it?
32. What is the differnce between embedded systems and the system in which rtos is running?
33. How can you define a structure with bit field members?
34. What are the features different in pSOS and vxWorks?
35. How do you write a function which takes 2 arguments - a byte and a field in the byte and returns the value of the field in that byte?
36. What are the different storage classes in C?
37. What are the different qualifiers in C?
38. What are the different BSD and SVR4 communication mechanisms

Computer architecture and design interview questions

1. What is pipelining?
2. What are the five stages in a DLX pipeline?
3. For a pipeline with ‘n’ stages, what’s the ideal throughput? What prevents us from achieving this ideal throughput?
4. What are the different hazards? How do you avoid them?
5. Instead of just 5-8 pipe stages why not have, say, a pipeline with 50 pipe stages?
6. What are Branch Prediction and Branch Target Buffers?
7. How do you handle precise exceptions or interrupts?
8. What is a cache?
9. What’s the difference between Write-Through and Write-Back Caches? Explain advantages and disadvantages of each.
10. Cache Size is 64KB, Block size is 32B and the cache is Two-Way Set Associative. For a 32-bit physical address, give the division between Block Offset, Index and Tag.
11. What is Virtual Memory?
12. What is Cache Coherency?
13. What is MESI?
14. What is a Snooping cache?
15. What are the components in a Microprocessor?
16. What is ACBF(Hex) divided by 16?
17. Convert 65(Hex) to Binary
18. Convert a number to its two’s compliment and back
19. The CPU is busy but you want to stop and do some other task. How do you do it?

Hardware design interview questions

1. Give two ways of converting a two input NAND gate to an inverter
2. Given a circuit, draw its exact timing response. (I was given a Pseudo Random Signal Generator; you can expect any sequential ckt)
3. What are set up time & hold time constraints? What do they signify? Which one is critical for estimating maximum clock frequency of a circuit?
4. Give a circuit to divide frequency of clock cycle by two 5. Design a divide-by-3 sequential circuit with 50% duty circle. (Hint: Double the Clock)
6. Suppose you have a combinational circuit between two registers driven by a clock. What will you do if the delay of the combinational circuit is greater than your clock signal? (You can’t resize the combinational circuit transistors)
7. The answer to the above question is breaking the combinational circuit and pipelining it. What will be affected if you do this?
8. What are the different Adder circuits you studied?
9. Give the truth table for a Half Adder. Give a gate level implementation of the same.
10. Draw a Transmission Gate-based D-Latch.
11. Design a Transmission Gate based XOR. Now, how do you convert it to XNOR? (Without inverting the output)
12. How do you detect if two 8-bit signals are same?
13. How do you detect a sequence of "1101" arriving serially from a signal line?
14. Design any FSM in VHDL or Verilog.
15. Explain RC circuit.s charging and discharging.
16. Explain the working of a binary counter.
17. Describe how you would reverse a singly linked list.

Microprocessor What is a microprocessor? Computers are not the only way in which microprocessors are used. Microprocessors also help many devices--your telephone, thermostat, car, or a traffic light, for instance--to remember and adjust to incoming information. This lets your phone redial, your thermostat automatically adjust, and thousands of other devices process details of daily life. --------------------------------------- 1 1.What is Microprocessor ? It is a program controlled semiconductor device (IC}, which fetches, decode and executes instructions. 2. What are the basic units of a microprocessor ? The basic units or blocks of a microprocessor are ALU, an array of registers and control unit. 3.what is Software and Hardware? The Software is a set of instructions or commands needed for performing a specific task by a programmable device or a computing machine. The Hardware refers to the components or devices used to form computing machine in which the software can be run and tested. Without software the Hardware is an idle machine. --------------------------------------- 2 4. What is assembly language? The language in which the mnemonics (short -hand form of instructions) are used to write a program is called assembly language. The manufacturers of microprocessor give the mnemonics. 5. What are machine language and assembly language programs? The software developed using 1's and 0's are called machine language, programs. The software developed using mnemonics are called assembly language programs. 6. What is the drawback in machine language and assembly language, programs? The machine language and assembly language programs are machine dependent. The programs developed using these languages for a particular machine cannot be directly run on another machine . 7. Define bit, byte and word. A digit of the binary number or code is called bit. Also, the bit is the fundamental storage unit of computer memory. The 8-bit (8-digit) binary number or code is called byte and 16-bit binary number or code is called word. (Some microprocessor manufactures refer the basic data size operated by the processor as word). --------------------------------------- 3 8. What is a bus? Bus is a group of conducting lines that carries data, address and control signals. 9. Why data bus is bi-directional? The microprocessor has to fetch (read) the data from memory or input device for processing and after processing, it has to store (write) the data to memory or output device. Hence the data bus is bi-directional. 10. Why address bus is unidirectional? The address is an identification number used by the microprocessor to identify or access a memory location or I / O device. It is an output signal from the processor. Hence the address bus is unidirectional. 11. What is the function of microprocessor in a system? The microprocessor is the master in the system, which controls all the activity of the system. It issues address and control signals and fetches the instruction and data from memory. Then it executes the instruction to take appropriate action. 12. What are the modes in which 8086 can operate? The 8086 can operate in two modes and they are minimum (or uniprocessor) mode and maximum ( or multiprocessor) mode. --------------------------------------- 4 13. What is the data and address size in 8086? The 8086 can operate on either 8-bit or 16-bit data. The 8086 uses 20 bit address to access memory and 16-bit address to access 1/0 devices. 14. Explain the function of M/IO in 8086. The signal M/IO is used to differentiate memory address and 1/0 address When the processor is accessing memory locations MI 10 is asserted high and when it is accessing 1/0 mapped devices it is asserted low. 15. Write the flags of 8086. The 8086 has nine flags and they are 1. Carry Flag (CF) 6. Overflow Flag (OF) 2. Parity Flag (PF) 7. Trace Flag (TF) 3. Auxiliary carry Flag (AF) 8. Interrupt Flag (IF) 4. Zero Flag (ZF) 9. Direction Flag (DF) 5. Sign Flag (SF) 16. What are the interrupts of 8086? The interrupts of 8085 are INTR and NMI. The INTR is general maskable interrupt and NMI is non-maskable interrupt. --------------------------------------- 5 17. How clock signal is generated in 8086? What is the maximum internal clock frequency of 8086? The 8086 does not have on-chip clock generation circuit. Hence the clock generator chip, 8284 is connected to the CLK pin of8086. The clock signal supplied by 8284 is divided by three for internal use. The maximum internal clock frequency of8086 is 5MHz. 18. Write the special functions carried by the general purpose registers of 8086. The special functions carried by the registers of 8086 are the following. Register Special function 1. AX 16-bit Accumulator 2. AL 8-bit Accumulator 3. BX Base Register 4. CX Count Register 5. DX .Data Register 19. What is pipelined architecture? In pipelined architecture the processor will have number of functional units and the execution time of functional units are overlapped. Each functional unit works independently most of the time. 20. What are the functional units available in 8086 architecture? The bus interface unit and execution unit are the two functional units available in 8086 architecture. --------------------------------------- 6 21. List the segment registers of 8086. The segment registers of 8086 are Code segment, Data segment, Stack segment and Extra segment registers. 22. Define machine cycle. Machine cycle is defined as the time required to complete one operation of accessing memory, I/O, or acknowledging an external request. This cycle may consist of three to six T-states. 23. Define T-State. T-State is defined as one subdivision of the operation performed in one clock period. These subdivisions are internal states synchronized with the system clock, and each T-State is precisely equal to one clock period. 24. List the components of microprocessor (single board microcomputer) based system The microprocessor based system consist of microprocessor as CPU, semiconductor memories like EPROM and RAM, input device, output device and interfacing devices. --------------------------------------- 7 25. Why interfacing is needed for 1/0 devices? Generally I/O devices are slow devices. Therefore the speed of I/O devices does not match with the speed of microprocessor. And so an interface is provided between system bus and I/O devices. 26. What is the difference between CPU bus and system bus? The CPU bus has multiplexed lines but the system bus has separate lines for each signal. (The multiplexed CPU lines are demultiplexed by the CPU interface circuit to form system bus). 27..What does memory-mapping mean? The memory mapping is the process of interfacing memories to microprocessor and allocating addresses to each memory locations. 28..What is interrupt 1/0? If the 1/0 device initiate the data transfer through interrupt then the 1/0 is called interrupt driven 1/0. 29. Why EPROM is mapped at the beginning of memory space in 8085 system? In 8085 microprocessor, after a reset, the program counter will have OOOOH address. If the monitor program is stored from this address then after a reset, it will be executed automatically. The monitor --------------------------------------- 8 program is a permanent program and stored in EPROM memory. If EPROM memory is mapped at the beginning of memory space, i.e., at OOOOH, then the monitor program will be executed automatically after a reset. 30. What is the need for system clock and how it is generated in 8085? The system clock is necessary for synchronizing various internal operations or devices in the microprocessor and to synchronize the microprocessor with other peripherals in the system. 31.What is DMA? The direct data transfer between I/O device and memory is called DMA. 32. What is the need for Port? The I/O devices are generally slow devices and their timing characteristics do not match with processor timings. Hence the I/O devices are connected to system bus through the ports. 33.What is a port? The port is a buffered I/O, which is used to hold the data transmitted from the microprocessor to I/O device or vice-versa. --------------------------------------- 9 34.Give some examples of port devices used in 8085 microprocessor based system? The various INTEL I/O port devices used in 8085 microprocessor based system are 8212, 8155, 8156, 8255, 8355 and 8755. 35. Write a short note on INTEL 8255? The INTEL 8255 is a I/O port device consisting of 3 numbers of 8 -bit parallel I/O ports. The ports can be programmed to function either as a input port or as a output port in different operating modes. It requires 4 internal addresses and has one logic LOW chip select pin. 36.What is the drawback in memory mapped I/0? When I/O devices are memory mapped, some of the addresses are allotted to I/O devices and so the full address space cannot be used for addressing memory (i.e., physical memory address space will be reduced). Hence memory mapping is useful only for small systems, where the memory requirement is less. 37. How DMA is initiated? When the I/O device needs a DMA transfer, it will send a DMA request signal to DMA controller. The DMA controller in turn sends a HOLD request to the processor. When the processor receives a HOLD request, it will drive its tri-stated pins to high impedance state at the end of current instruction execution and send an acknowledge signal to DMA controller. Now the DMA controller will perform DMA transfer. --------------------------------------- 10 38. What is processor cycle (Machine cycle)? The processor cycle or machine cycle is the basic operation performed by the processor. To execute an instruction, the processor will run one or more machine cycles in a particular order. 39. What is Instruction cycle? The sequence of operations that a processor has to carry out while executing the instruction is called Instruction cycle. Each instruction cycle of a processor indium consists of a number of machine cycles. 40. What is fetch and execute cycle? In general, the instruction cycle of an instruction can be divided into fetch and execute cycles. The fetch cycle is executed to fetch the opcode from memory. The execute cycle is executed to decode the instruction and to perform the work instructed by the instruction. 41.What is Block and Demand transfer mode DMA? In Block transfer mode, the DMA controller will transfer a block of data and relieve the bus for processor. After sometime another block of data is transferred by DMA and so on. In Demand transfer mode the DMA controller will complete the entire .data transfer at a stretch and then relieve the bus to processor. --------------------------------------- 11 42. What is the need for timing diagram? The timing diagram provides information regarding the status of various signals, when a machine cycle is executed. The knowledge of timing diagram is essential for system designer to select matched peripheral devices like memories, latches, ports, etc., to form a microprocessor system. 43. How many machine cycles constitute one instruction cycle in 8085? Each instruction of the 8085 processor consists of one to five machine cycles. 44. Define opcode and operand. Opcode (Operation code) is the part of an instruction / directive that identifies a specific operation. Operand is a part of an instruction / directive that represents a value on which the instruction acts. 45. What is opcode fetch cycle? The opcode fetch cycle is a machine cycle executed to fetch the opcode of an instruction stored in memory. Every instruction starts with opcode fetch machine cycle. --------------------------------------- 12 46. What operation is performed during first T -state of every machine cycle in 8085 ? In 8085, during the first T -state of every machine cycle the low byte address is latched into an external latch using ALE signal. 47. Why status signals are provided in microprocessor? The status signals can be used by the system designer to track the internal operations of the processor. Also, it can be used for memory expansion (by providing separate memory banks for program & data and selecting the bank using status signals). 48. How the 8085 processor differentiates a memory access (read/write) and 1/0 access (read/write)? The memory access and 1/0 access is differentiated using 10 I M signal. The 8085 processor asserts 10 I M low for memory read/write operation and 10 I M is asserted high for 1/0 read/write operation. 49. When the 8085 processor checks for an interrupt? In the second T -state of the last machine cycle of every instruction, the 8085 processor checks whether an interrupt request is made or not. 50. What is interrupt acknowledge cycle? The interrupt acknowledge cycle is a machine cycle executed by 8085 processor to get the address of the interrupt service routine in-order to service the interrupt device. --------------------------------------- 13 51. How the interrupts are affected by system reset? Whenever the processor or system is resetted , all the interrupts except TRAP are disabled. fu order to enable the interrupts, El instruction has to be executed after a reset. 52. What is Software interrupts? The Software interrupts are program instructions. These instructions are inserted at desired locations in a program. While running a program, if software interrupt instruction is encountered then the processor executes an interrupt service routine. 53. What is Hardware interrupt? If an interrupt is initiated in a processor by an appropriate signal at the interrupt pin, then the interrupt is called Hardware interrupt. 54. What is the difference between Hardware and Software interrupt? The Software interrupt is initiated by the main program, but the Hardware interrupt is initiated by an external device. In 8085, the Software interrupt cannot be disabled or masked but the Hardware interrupt except TRAP can be disabled or masked. --------------------------------------- 14 55. What is Vectored and Non- Vectored interrupt? When an interrupt is accepted, if the processor control branches to a specific address defined by the manufacturer then the interrupt is called vectored interrupt. In Non-vectored interrupt there is no specific address for storing the interrupt service routine. Hence the interrupted device should give the address of the interrupt service routine. 56. List the Software and Hardware interrupts of 8085? Software interrupts: RST 0, RSTl, RST 2, RST 3, RST 4, RST 5, RST 6 and RST 7. Hardware interrupts: TRAP, RST 7.5, RST 6.5, RST 5.5 and INTR. 57. What is TRAP? The TRAP is non-maskable interrupt of8085. It is not disabled by processor reset or after reorganization of interrupt. 58. Whether HOLD has higher priority than TRAP or not? The interrupts including mAP are recognized only if the HOLD is not valid, hence TRAP has lower priority than HOLD. --------------------------------------- 15 59. What is masking and why it is required? Masking is preventing the interrupt from disturbing the current program execution. When the processor is performing an important job (process) and if the process should not be interrupted then all the interrupts should be masked or disabled. In processor with multiple 'interrupts, the lower priority interrupt can be masked so as to prevent it from interrupting, the execution of interrupt service routine of higher priority interrupt. 60. When the 8085 processor accept hardware interrupt? The processor keeps on checking the interrupt pins at the second T -state of last Machine cycle of every instruction. If the processor finds a valid interrupt signal and if the interrupt is unmasked and enabled then the processor accepts the interrupt. The acceptance of the interrupt is acknowledged by sending an OOA signal to the interrupted device. 61. When the 8085 processor will disable the interrupt system? The interrupts of 8085 except TRAP are disabled after anyone of the following operations 1. Executing El instruction. 2. System or processor reset. 3. After reorganization (acceptance) of an interrupt. --------------------------------------- 16 62. What is the function performed by Dl instruction? The function of Dl instruction is to enable the disabled interrupt system. 63. What is the function performed by El instruction? The El instruction can be used to enable the interrupts after disabling. 64. How the vector address is generated for the INTR interrupt of 8085? For the interrupt INTR, the interrupting device has to place either RST opcode or CALL opcode followed by l6-bit address. I~RST opcode is placed then the corresponding vector address is generated by the processor. In case of CALL opcode the given l6-bit address will be the vector address. 65. How clock signals are generated in 8085 and what is the frequency of the internal clock? The 8085 has the clock generation circuit on the chip but an external quartz crystal or L C circuit or RC circuit should be connected at the pins XI and X2. The maximum internal clock frequency of 8085A is 3.03 MHz. --------------------------------------- 17 66. What happens to the 8085 processor when it is resetted? When the 8085 processor is resetted it execute the first instruction at the OOOOH location. The 8085 resets (clears) instruction register, interrupt mask bits and other registers. 67. What are the operations performed by ALU of 8085? The operations performed by ALU of 8085 are Addition, Subtraction, Logical AND, OR, Exclusive OR, Compare Complement, Increment, Decrement and Left I Right shift 68. What is a flag? Flag is a flip flop used to store the information about the status of the processor and the status of the instruction executed most recently. 69. List the flags of 8085 There are five flags in 8085. They are sign flag, zero flag, Auxiliary carry flag, parity flag and carry flag. 70. What is the Hardware interrupts of 8085? The hardware interrupts in 8085 are TRAP, RST 7.5, RST 6.5 and RST 5,5. 41. --------------------------------------- 18 71.Which interrupt has highest priority in 8085? What is the priority of other interrupts? The TRAP has the highest priority, followed by RST 7.5, RST 6.5, RST 5.5 and INTR. 72 What is an ALE? The ALE (Address Latch Enable) is a signal used to demultiplex the address and data lines, using an external latch. It is used to enable the external latch. 73. Explain the function of IO/M in 8085. The IO/M is used to differentiate memory access and I/O access. For IN and OUT instruction it is high. For memory reference instructions it is low. 74. Where is the READY signal used? READY is an input signal to the processor, used by the memory or I/O devices to get extra time for data transfer or to introduce wait states in the bus cycles. 75. What is HOLD and HLDA and how it is used? Hold and hold acknowledge signals are used for the Direct Memory Access (DMA) type of data transfer. The DMA controller place a high on HOLD pin in order to take control of the system bus. The HOLD request is acknowledged by the 8085 by driving all its tristated pins to high impedance state and asserting HLDA signal high. --------------------------------------- 19 76.What is Polling? Polling is a scheme or an algorithm to identify the devices interrupting the processor. Polling is employed when multiple devices interrupt the processor through one interrupt pin of the processor. 77. What are the different types of Polling? The polling can be classified into software and hardware polling. In software polling the entire polling process is govern by a prograrn.1n hardware polling, the hardware takes care of checking the status of interrupting devices and allowing one by one to the processor. 78.What is the need for interrupt controller? The interrupt controller is employed to expand the interrupt inputs. It can handle the interrupt request from various devices and allow one by one to the processor. 79. List some of the features of INTEL 8259 (Programmable Interrupt Controller) 1. It manage eight interrupt request 2. The interrupt vector addresses are programmable. 3. The priorities of interrupts are programmable. 4. The interrupt can be masked or unmasked individually. --------------------------------------- 20 80. What is a programmable peripheral device ? If the functions performed by a peripheral device can be altered or changed by a program instruction then the peripheral device is called programmable device. Usually the programmable devices will have control registers. The device can be programmed by sending control word in the prescribed format to the control register. 81. What is synchronous data transfer scheme? For synchronous data transfer scheme, the processor does not check the readiness of the device after a command have been issued for read/write operation. fu this scheme the processor will request the device to get ready and then read/W1.ite to the device immediately after the request. In some synchronous schemes a small delay is allowed after the request. 82. What is asynchronous data transfer scheme? In asynchronous data transfer scheme, first the processor sends a request to the device for read/write operation. Then the processor keeps on polling the status of the device. Once the device is ready, the processor execute a data transfer instruction to complete the process. 83. What are the operating modes of 8212? The 8212 can be hardwired to work either as a latch or tri-state buffer. If mode (MD) pin is tied HIGH then it will work as a latch and so it --------------------------------------- 21 can be used as output port. If mode (MD) pin is tied LOW then it work as tri- state buffer and so it can be used as input port. 84. Explain the working of a handshake output port In handshake output operation, the processor will load a data to port. When the port receives the data, it will inform the output device to collect the data. Once the output device accepts the data, the port will inform the processor that it is empty. Now the processor can load another data to port and the above process is repeated. 85.What are the internal devices of 8255 ? The internal devices of 8255 are port-A, port-B and port-C. The ports can be programmed for either input or output function in different operating modes. 86. What is baud rate? The baud rate is the rate at which the serial data are transmitted. Baud rate is defined as l /(The time for a bit cell). In some systems one bit cell has one data bit, then the baud rate and bits/sec are same. 87. What is USART? The device which can be programmed to perform Synchronous or Asynchronous serial communication is called USART (Universal Synchronous Asynchronous Receiver Transmitter). The INTEL 8251A --------------------------------------- 22 is an example of USART. 88. What are the functions performed by INTEL 8251A? The INTEL 825lA is used for converting parallel data to serial or vice versa. The data transmission or reception can be either asynchronously or synchronously. The 8251A can be used to interface MODEM and establish serial communication through MODEM over telephone lines. 89. What is an Interrupt? Interrupt is a signal send by an external device to the processor so as to request the processor to perform a particular task or work. 90. What are the control words of 8251A and what are its functions ? The control words of 8251A are Mode word and Command word. The mode word informs 8251 about the baud rate, character length, parity and stop bits. The command word can be send to enable the data transmission and reception. 91. What are the information that can be obtained from the status word of 8251 ? The status word can be read by the CPU to check the readiness of the transmitter or receiver and to check the character synchronization in synchronous reception. It also provides information regarding various errors in the data received. The various error conditions that can be --------------------------------------- 23 checked from the status word are parity error, overrun error and framing error. 92. Give some examples of input devices to microprocessor-based system. The input devices used in the microprocessor-based system are Keyboards, DIP switches, ADC, Floppy disc, etc. 93. What are the tasks involved in keyboard interface? The task involved in keyboard interfacing are sensing a key actuation, Debouncing the key and Generating key codes (Decoding the key). These task are performed software if the keyboard is interfaced through ports and they are performed by hardware if the keyboard is interfaced through 8279. 94. How a keyboard matrix is formed in keyboard interface using 8279? The return lines, RLo to RL7 of 8279 are used to form the columns of keyboard matrix. In decoded scan the scan lines SLo to SL3 of 8279 are used to form the rows of keyboard matrix. In encoded scan mode, the output lines of external decoder are used as rows of keyboard matrix. 95. What is scanning in keyboard and what is scan time? The process of sending a zero to each row of a keyboard matrix and reading the columns for key actuation is called scanning. The scan time --------------------------------------- 24 is the time taken by the processor to scan all the rows one by one starting from first row and coming back to the first row again. 96. What is scanning in display and what is the scan time? In display devices, the process of sending display codes to 7 -segment LEDs to display the LEDs one by one is called scanning ( or multiplexed display). The scan time is the time taken to display all the 7-segment LEDs one by one, starting from first LED and coming back to the first LED again. 97. What are the internal devices of a typical DAC? The internal devices of a DAC are R/2R resistive network, an internal latch and current to voltage converting amplifier. 98. What is settling or conversion time in DAC? The time taken by the DAC to convert a given digital data to corresponding analog signal is called conversion time. 99. What are the different types of ADC? The different types of ADC are successive approximation ADC, counter type ADC flash type ADC, integrator converters and voltage- to-frequency converters. --------------------------------------- 25 100. Define stack Stack is a sequence of RAM memory locations defined by the programmer. 101. What is program counter? How is it useful in program execution? The program counter keeps track of program execution. To execute a program the starting address of the program is loaded in program counter. The PC sends out an address to fetch a byte of instruction from memory and increments its content automatically. 102. How the microprocessor is synchronized with peripherals? The timing and control unit synchronizes all the microprocessor operations with clock and generates control signals necessary for communication between the microprocessor and peripherals. 103. What is a minimum system and how it is formed in 8085? A minimum system is one which is formed using minimum number of IC chips, The 8085 based minimum system is formed using 8155,8355 and 8755. 104. What is mean by microcontroller A device which contains the microprocessor with integrated peripherals like memory, serial ports, parallel ports, timer/counter, interrupt controller, data acquisition interfaces like ADC,DAC is called microcontroller. --------------------------------------- 26 105.List the features of 8051 microcontroller? The features are *single_supply +5 volt operation using HMOS technology. *4096 bytes program memory on chip(not on 8031) *128 data memory on chip. *Four register banks. *Two multiple mode,16-bit timer/counter. *Extensive boolean processing capabilities. *64 KB external RAM size *32 bidirectional individually addressible I/O lines. *8 bit CPU optimized for control applications. 106.Explain the operating mode0 of 8051 serial ports? In this mode serial enters &exits through RXD, TXD outputs the shift clock.8 bits are transmitted/received:8 data bits(LSB first).The baud rate is fixed at 1/12 the oscillator frequency. 107 Explain the operating mode2 of 8051 serial ports? In this mode 11 bits are transmitted(through TXD)or received (through RXD):a start bit(0), 8 data bits(LSB first),a programmable 9th data th bit ,& a stop bit(1).ON transmit the 9 data bit (TB* in SCON)can be assigned the value of 0 or 1.Or for eg:, the parity bit(P, in the PSW)could be th moved into TB8.On receive the 9 data bit go in to the RB8 in Special --------------------------------------- 27 Function Register SCON, while the stop bit is ignored. The baud rate is programmable to either 1/32or1/64 the oscillator frequency. 108. Explain the mode3 of 8051 serial ports? In this mode,11 bits are transmitted(through TXD)or received(through RXD):a start bit(0), 8 data bits(LSB first),a programmable 9th data bit ,& a stop bit(1).In fact ,Mode3 is the same as Mode2 in all respects except the baud rate. The baud rate in Mode3 is variable. In all the four modes, transmission is initiated by any instruction that uses SBUF as a destination register. Reception is initiated in Mode0 by the condition RI=0&REN=1.Reception is initiated in other modes by the incoming start bit if REN=1.

109.Explain the interrupts of 8051 microcontroller?
The interrupts are:
Vector address · External interrupt 0 : IE0 : 0003H
· Timer interrupt 0 : TF0 : 000BH
· External interrupt 1 : IE1 : 0013H
· Timer Interrupt 1 : TF1 : 001BH
· Serial Interrupt
Receive interrupt : RI : 0023H
Transmit interrupt: TI : 0023H

110.Write A program to perfom multiplication of 2 nos using 8051?
MOV A,#data 1
MOV B,#data 2
MUL AB
MOV DPTR,#5000
MOV @DPTR,A(lower value)
INC DPTR
MOV A,B
MOVX @ DPTR,A thth

111.Write a program to mask the 0 &7 bit using 8051?
MOV A,#data
ANL A,#81
MOV DPTR,#4500
MOVX @DPTR,A
LOOP SJMP LOOP

112.List the addressing modes of 8051?
· Direct addressing
· Register addressing
· Register indirect addressing.
· Implicit addressing
· Immediate addressing
· Index addressing
· Bit addressing

113.Write about CALL statement in 8051?
There are two subroutine CALL instructions. They are
*LCALL(Long CALL)
*ACALL(Absolute CALL)
st Each increments the PC to the 1 byte of the instruction & pushes them in to the stack.

114.Write about the jump statement?
There are three forms of jump. They are LJMP(Long jump)-address 16
AJMP(Absolute Jump)-address 11
SJMP(Short Jump)-relative address

115.Write program to load accumulator ,DPH,&DPL using 8051?
MOV A,#30
MOV DPH,A
MOV DPL,A

116.Write a program to find the 2’s complement using 8051?
MOV A,R0
CPL A
INC A

117.Write a program to add 2 8-bit numbers using 8051?
MOV A,#30H
ADD A,#50H

118.Write a program to swap two numbers using 8051?
MOV A, #data
SWAP A

119.Write a program to subtract 2 8-bit numbers &exchange the digits using 8051?
MOV A,#9F
MOV R0,#40
SUBB A,R0
SWAP A

120.Write a program to subtract the contents of R1 of Bank 0from the contents of R0 of Bank 2 using 8051?
MOV PSW,#10
MOV A,R0
MOV PSW,#00
SUBB A,R1

1. Draw & explain the architecture of 8085 microprocessor
· Block Diagram
· Registers Available
· Function Of Accumulator
· Explanation about all blocks in the block diagram

2. Draw the Pin Diagram of 8085 and explain the function of various signals.
· Pin Diagram
· Explanation about all signals

3. Explain the instruction classification & instruction sets
· Data Transfer Instructions
· Arithmetic Instructions
· Logical Instructions
· Branch Instructions
· Machine Control Instructions

4. Write a program to sort the numbers in ascending and descending order.
· Program
· Result Verification

5.Draw the timing diagram of the following Instructions
· PUSH
· IN Port A
· STA 5000
· MVI A, 08
· Explain the machine cycles needed for every Instructions and draw the timing diagram

6. Explain the 8085 based microcomputer system

7. With neat sketch explain the functions of 8255 PPI.
· Block Diagram
· Explanation about all the ports available.
· Explanation about the modes of transfer
· Explain the control Word Register

8. With neat sketch explain the functions of 8251.
· Block Diagram
· Types of data transfer
· Explanation about all the blocks.
· Explain the control Word Register, Status Register

9. With neat sketch explain the function of DMA contoller.
· Block Diagram
· Explanation about all blocks in the block diagram

10.With neat sketch explain the function of Programmable Interrupt Controller.
· Block Diagram
· Explanation about all blocks in the block diagram

11.With neat sketch explain the function of Keyboard and display controller.
· Block Diagram
· Types of Display Available
· Types of keys available
· Explanation about all blocks in the block diagram

12. With neat sketch explain the function of A/D converter.
· Fundamental steps
· Figure
· Explain the functions.

13. With neat sketch explain the function of D/A converter. · Fundamental steps
· Figure
· Explain the functions.

14.With neat sketch explain the architecture of 8051 microcontroller.
· Block Diagram
· Explanation about all blocks in the block diagram

15. Draw the Pin Diagram of 8051 and explain the function of various signals.
· Pin Diagram
· Explanation about all signals

16. List the various Instruction available in 8051 microcontroller.
· Data Transfer Instructions
· Arithmetic Instructions
· Logical Instructions
· Boolean variable Manipulation Instructions
· Program and Machine Control Instructions