[1]. Differentiate register and memory with examples. 1. Register : Registers are the smallest data holding elements that are built into the processor itself. These are the memory locations that are directly accessible by the processor. It may hold an instruction, a storage address or any kind of data such as a bit sequence or individual characters. For example, an instruction may specify that the contents of two defined registers be multiplied together and then placed in a specific register. Example: Accumulator register, Program counter, Instruction register, Address register, etc. 2. Memory : Memory is a hardware device used to store computer programs, instructions and data. The memory that is internal to the processor is a primary memory (RAM), and the memory that is external to the processor is a secondary memory (Hard Drive). Memory can also be categorized on the basis of volatile and nonvolatile memory. Volatile memory is memory that loses its contents when the computer or hardware device loses power. RAM (Random Access Memory) is an example of volatile memory. Non-volatile memory is the memory that keeps its contents even if power gets lost. EPROM is an example of nonvolatile memory. Example : RAM, EPROM etc. BASIS FOR COMPARISON REGISTER MEMORY Basic Registers hold the operands or instruction that CPU is currently processing. Memory holds the instructions and the data that the currently executing program in CPU requires. Capacity Register holds the small amount of data around 32-bits to 64-bits. Memory of the computer can range from some GB to TB. Access CPU can operate on register contents at the rate of more than one operation in one clock cycle. CPU accesses memory at the slower rate than register. Type Accumulator register, Program counter, Instruction register, Address register, etc. RAM. [2]. What is the difference between microprocessor and micro controller? KEY DIFFERENCES Microprocessor consists of only a Central Processing Unit, whereas Micro Controller contains a CPU, Memory, I/O all integrated into one chip. Microprocessor is used in Personal Computers whereas Micro Controller is used in an embedded system. Microprocessor uses an external bus to interface to RAM, ROM, and other peripherals, on the other hand, Microcontroller uses an internal controlling bus. Microprocessors are based on Von Neumann model Micro controllers are based on Harvard architecture Microprocessor is complicated and expensive, with a large number of instructions to process but Microcontroller is inexpensive and straightforward with fewer instructions to process. Types of Microprocessor Important types of Microprocessors are: Complex Instruction Set Microprocessors The Application Specific Integrated Circuit Reduced Instruction Set Microprocessors Digital Signal Multiprocessors (DSPs) Types of Microcontroller Here are important types of Microcontroller: 8 bit Microcontroller 16 bit Microcontroller 32 bit Microcontroller Embedded Microcontroller External memory Microcontroller [3]. What is microprocessor? What are the application areas where microprocessor is used? A microprocessor makes daily life easier because of its low cost, low power, small weight, and vast application in every field. There are several applications of microprocessors. Some of the important applications are: Household Devices o The programmable thermostat allows the control of temperature at homes. In this system, a microprocessor works with the temperature sensor to determine and adjust the temperature accordingly. o High-end coffee makers, Washing machines, and radio clocks contain microprocessor technology. o Some other home items that contain microprocessors are: microwaves, toasters, televisions, VCRs, DVD players, ovens, stoves, clothes washers, stereo systems, home computers, alarm clocks, hand-held game devices, thermostats, video game systems, bread machines, dishwashers, home lighting systems and even some refrigerators with digital temperature control. Industrial Applications of Microprocessors o Some industrial items which use microprocessors technology include: cars, boats, planes, trucks, heavy machinery, elevators, gasoline pumps, credit-card processing units, traffic control devices, computer servers, most high tech medical devices, surveillance systems, security systems, and even some doors with automatic entry. Transportation Industry o Automobiles, trains and planes also use microprocessor technology. o Consumer vehicles-buses, cars, trucks -integrate microprocessors to communicate important information throughout the vehicle. E.g., navigation systems provide information using microprocessors and global positioning system (GPS) technology. Computers and Electronics o Microprocessor-drives technology is the brain of the computer. They are used in all type of computers ranging from microcomputers to supercomputers. o A cell phone or mobile device executes game instructions by way of the microprocessor. o VCRs, televisions and gaming platforms also contain microprocessors for executing complex instructions and tasks. In Medicals o Many medical devices, like an insulin pump, are typically controlled by a microprocessor. The microprocessors perform various functions, such as processing data from biosensors, storing measurements, and analyzing results. Instrumentation o Microprocessor is also very useful in the field of instrumentation. Function generators, frequency counters, frequency synthesizers, spectrum analyses and many other instruments are available, when microprocessors are used as controller. Entertainment o The use of microprocessor in entertainment equipment, toys and home entertaining applications is making them more useful and full of features. Embedded Systems at Home o A number of modern devices in the home are microprocessor based i.e. camera; washing machines; calculators; hi-fi systems; telephones; microwave ovens; burglar alarms etc. The input are usually simple numeric keyboards, sensors, buttons or while the output include lights, simple LCD screens displays, motors and relays, LEDs, buzzers etc. Office Automation and Publication o Microprocessor based system with software packages has changed the office environment. Microprocessors based systems are being used for spread sheet operations, word processing, storage etc. o The Publication technology has revolutionized by the microprocessor. Communication o In communication the telephone industry is most important. In this industry, microprocessors are used in digital telephone sets, telephone exchanges and modem etc. o The use of microprocessor in satellite communication, television, has made teleconferencing possible. o Railway reservation and airline reservation system also uses microprocessor technology. WAN (Wide Area Network) and LAN (Local Area Network) for communication of vertical information through computer network. [4]. Compare and contrast 8085 and 8086 microprocessor The 8085 is an 8-bit microprocessor. It was produced by Intel and first introduced in 1976. The 8086 is enhanced version of 8085 microprocessor. It is 16-bit processor. Now let us see some basic differences between these two. Property 8085 Microprocessor 8086 Microprocessor Data Bus Size 8-Bit 16-Bit Address Bus Size 16-bit 20-bit Clock Speed 3MHz Varies in range 5.8 – 10 MHz Duty Cycle for clock 50% 33% Flags It has 5 flags (Sign, Zero, Auxiliary Carry, Parity, Carry) It has 9 flags (Overflow, Direction, Interrupt. Trap, Sign, Zero, Auxiliary Carry, Parity, Carry) Pipelining Support Does not support Supports Memory Segmentation supports Does not support Supports Number of transistors Nearly 6500 Nearly 29000 Processor type Accumulator based General Purpose register based Property 8085 Microprocessor 8086 Microprocessor Presence of Minimum and Maximum mode Not present Present Number of processors Only one processor is used More than one processor is used. Additional processor (external) can also be employed Memory Size 64KB 1MB Instruction No multiplication and division instruction Multiplication and Division operations are present Instruction Queue Support Does not support Supports [5]. Explain the internal architecture of 8086 microprocessor. As the figure shows, the 8086 microprocessor is divided into two independent functional parts: 1.Bus Interface Unit 2.Execution Unit Bus Interface Unit (BIU) of 8086 Microprocessor The Bus Interface Unit of 8086 microprocessor manages all the data and addresses transfers for the Execution Unit (EU) like sending address, fetching an instruction, reading data from the memory/ports as well as writing data to the ports/memory. The Execution Unit of the 8086 microprocessor has no direct connection to the system bus so this is possible with BIU. The BIU and EU are connected by an internal bus as shown in the block diagram above. The BIU of 8086 microprocessor has the following functional parts: 1. Instruction Queue The Bus Interface Unit of the 8086 microprocessor contains an instruction queue. BIU gets up to six bytes of the next instructions and stores them in the instruction queue. When the Execution unit executes an instruction and is ready for the next instruction, it simply reads the instruction from the instruction queue resulting in increased execution speed. Pipelining is the process of fetching the next instruction cycle when the current instruction is being executed. 2. Segment Register The BIU of 8086 microprocessor has 4 segment buses i.e. CS, DS, SS & ES. Ts holds the address of instructions and data in the memory which are used by the processor to access memory locations. It also contains one pointer register IP. (i) Code Segment Register (CS) The base of the current code segment is contained by the code segment register of the 8086 microprocessor. It finds its application in addressing a memory location in the code segment of the memory where the executable program is stored. (ii) Data Segment Register (DS) The data segment contains the starting address of the program’s data segment. It is accessed in the data segment by an offset address or the content of the other register that holds the offset address. (iii) Stack Segment Register (SS) The stack segment register of the 8086 microprocessor contains the starting address of a program’s stack segment. The current word in the stack that is addressed is indicated by the segment address plus an offset value in the stack pointer. (iv) Extra Segment Register (ES) The ES of the 8086 microprocessor is an additional data segment used by some strings to hold extra data. The string instructions always use the ES and destination index (DI) to determine the 20-bit physical address. (v) Instruction Pointer Register (IP) The Instruction Pointer is a 16-bit register. IP is responsible for holding the distance or offset from this address to the next instruction byte to be fetched. Execution Unit (EU) The execution unit of the 8086 gives instructions to the bus interface unit stating from where to fetch the instructions or data from, decode the instructions, and execute those instructions. The main function of the EU of the 8086 microprocessor is to control operations on data using an instruction decoder and ALU. It has no direct connection with the system and performs over data through BIU. The EU includes an arithmetic and logic unit (ALU), a control unit, and a set of registers. 1. ALU The arithmetic and logic unit performs all the arithmetic and logical operations like add, subtract, OR, AND, NOT in the 8086 microprocessor. 2. General-Purpose Registers The 8086 microprocessor has 8 registers AH, AL, BH, BL, CH, CL, DH, DL. Individually, these registers can store 8-bit data, and in pairs, they can store 16-bit data. The valid register pairs are AHAL, BHBL, CHCL, DHDL. They can be represented as AX, BX, CX, and DX. a. AX Register The AX register is called a 16-bit accumulator and AL is called the 8-bit accumulator. For inputting/outputting data from or to I/O ports, the I/O (IN or OUT) instructions often use AX or AL. b. BX Register The BX register of the 8086 microprocessor is known as the base register. It is used to store the starting base address of the memory field within the data section. It is also used as an index to extend addressing. BX can also be used as a foundation register in conjunction with DI or SI for special addressing. c. CX Register The contents of the CX register of the 8086 microprocessor are used as a counter in certain instructions such as SHIFT, ROTATE, and LOOP. d. DX Register The DX register of the 8086 microprocessor is known as the data register. It is used to hold the I/O port address during the I/O instructions. 3. Stack Pointer Register (SP) and Base Pointer Register (BP) Both the SP and BP registers in the 8086 microprocessor are used to access data in the stack segment. During the execution of instructions, the SP is used as an offset from the current stack section. The contents of SP are automatically updated (increment/decrement) during the execution of a POP and PUSH instruction. The offset address in the current stack section is stored in the BP. Instructions that use the based addressing mode make use of this offset. 4. Index Register The two index registers SI (source index) and DI (destination index) o the 8086 microprocessor are used in indexed addressing. The instructions that process data strings use the SI and DI index registers, along with DS and ES, to differentiate between the source and destination address. 5. Flag Register The flag register of the 8086 microprocessor is also known as the status register. It is a 16-bit register that can be used as a flipflop as its status changes according to the result. The control bit in the flag register can be set or reset by the programmer. It has 9 flags and they are divided into two groups: Conditional flags and Control flags. Conditional flags These flags reflect the outcome of the most recent arithmetic or logical instruction. Following is the list of conditional flags of the 8086 microprocessor: a. Carry flag(C) This flag is set in an 8086 microprocessor when there is a carry out of MSB in addition or borrow in subtraction. b. Parity flag (P) This flag is set to 1 if the lower byte of the result contains an even number of 1’s otherwise reset. c. Auxiliary Carry flag (A) This is set if there is carry from the lowest nibble during addition or borrow from the lowest bibble during subtraction in an 8086 microprocessor. d. Zero flag (Z) If the product of arithmetic or logical operations is zero, this flag is set to 1, otherwise, it is set to 0. e. Sign flag (S) This flag bears the result’s symbol. i.e. when the result of the operation is negative, the sign flag is set to 1 else it is set 0. f. Overflow flag (O) This flag indicates what happens when the system’s capability is surpassed. g. Control flags Control flags govern the execution unit’s activities. They are: h. Trap flag (T) This flag is used for single-step monitoring and helps the user to debug by executing one instruction at a time. If it is set, then the program can run in a single-step mode. i. Interrupt flag (I) It is an interrupt enable/disable flag i.e. It is used to authorize or prevent program interruption. It is set 1 for interrupt enabled condition and set 0 for interrupt disabled condition. j. Direction flag (D) This flag is used for string manipulation instructions. If this parameter is set to0, the string is processed from the lowest to the highest address. i.e. the string is processed from the highest address to the lowest address unless the auto-incrementing mode is used i.e. auto decrementing mode.