Вы находитесь на странице: 1из 13

Student: Cecilito B.

Tago

Instructor: Engr. Myrth Manlangit CPE 423 Microprocessors

1. What is the purpose of PC? The purpose of the personal computer is to perform calculations, retrieve data store information and process information. A computer has data that is programmed or computer language that tells the computer how to implement its purpose. The computer only does what it is programmed to do. The PC has impacted the world in many ways. For instance, PC's have changed the way we communicate with others in the world. One could be many miles away from a friend or family member and still stay in touch via the Internet. We can view information faster and keep things easier and more organized. It is also more cost efficient and boosts productivity. 2. What is the role of memory? Classify the memories. A computer uses RAM to hold temporary instructions and data needed to complete tasks. This enables the computers CPU (Central Processing Unit), to access instructions and data stored in memory very quickly. A good example of this is when the CPU loads an application program such as a word processing or page layout program into memory, thereby allowing the application program to work as quickly and efficiently as possible. In practical terms, having the program loaded into memory means you can get work done more quickly with less time spent waiting for the computer to perform tasks. The process begins when you enter a command from your keyboard. The CPU interprets the command and instructs the hard drive to load the command or prgram into memory. Once the data is loaded into memory, the CPU is able to access it much more quickly than if it had to retrieve it from the hard drive. This process of putting things the CPU needs in a place where it can get at them more quickly is similar to placing various electronic files and documents youre using on the computer into a single file folder or directory. By doing so, you keep all the files you need handy and avoid searching in several places every time you need them If you've ever had more memory added to your PC, you probably noticed a performance improvement right away. With a memory upgrade, applications respond more quickly, Web pages load faster, and you can have more programs running simultaneously. In short, additional memory can make using your computer a lot more enjoyable.

Without Random Access Memory (RAM) your computer system would not be able to recall and locate programs on your computer. It is this Random Access Memory (RAM) that details and catalogues every move that you make on your computer. Random Access Memory (RAM) gets it name from the fact that it can randomly call up memory in any order that you choose to activate a program. The Random Access Memory (RAM) of your computer is so sophisticated that it can call upon and collect every detail of your computer experience with ease. Every program installed on your computer requires memory in order to function correctly. If you computer did not have Random Access Memory (RAM) you would not even be able to turn the computer on. This is how vitally important computer memory is. RAM is a very high-speed type of memory, which makes it ideal for storing active programs and system processes. It is different than hard disk space in that RAM is made up of physical memory chips, while hard disks are magnetic disks that spin inside a hard drive. Accessing RAM is much faster than accessing the hard disk because RAM access is based on electric charges, while the hard drive needs to seek to the correct part of the disk before accessing data. However, all the information stored in RAM is erased when the computer's power is turned off. The hard disk, on the other hand, stores data magnetically without requiring any electrical power. Another common type of memory is flash memory, which is typically used for small devices such as digital cameras, USB keychain drives, and portable music players like the iPod nano. This kind of memory, known as "electrically erasable programmable read-only memory" (EEPROM), is convenient for portable devices, since it stores information even when its power source is turned off, but is smaller and more resilient than a hard drive. ROM (read-only memory) is just that - read-only. It is typically used to store small programs that never change. BIOS information in all modern computers is stored in ePROM (flash) memory so that updates can be downloaded & installed w/out having to replace a ROM chip. Read-only memory (ROM) is a class of storage medium used in computers and other electronic devices. Data stored in ROM cannot be modified, or can be modified only slowly or with difficulty, so it is mainly used to distribute firmware (software that is very closely tied to specific hardware, and unlikely to need frequent updates). Other types of non-volatile memory such as erasable programmable read only memory (EPROM) and electrically erasable programmable read-only memory (EEPROM or Flash ROM) are sometimes referred to, in an abbreviated way, as "read-only memory" (ROM); although these types of memory can be erased and re-programmed multiple times, writing to this memory takes longer and may require different procedures than reading the memory.[1] When used in this less precise way, "ROM" indicates a non-volatile memory which serves functions typically provided by mask ROM, such as storage of program code and nonvolatile data.

In general, there are two classifications of memories the ROM and RAM. ROM (Read Only Memory) is a non volatile data storage the retains the data even after power off. It is use for permanent storage of system software and data. PROM, EPROM and EEPROM (Flash) memory are considered as memories that belong to the classifications of ROM. While on the other hand RAM (Read Access Memory) is a volatile data storage meaning the data disappears after power off. It is use for temporary storage of application software and data. SRAM and DRAM are classified under the family of RAM. RAM: RAM (Random Access Memory) is the most commonly known type of computer memory. RAM received its name from its ability to directly access any memory cell. The operating system, software applications and other data currently in use, are kept here so they can be quickly accessed by the processor. The processor is able to read and write from RAM faster than any other storage media on the computer such as a cd-rom, floppy disk, or even the hard drive itself. RAM is temporary storage as data only remains there when the machine is running. When you shut down the computer, RAM loses all of its data. When you start it back up, the operating systems and your others files are loaded from the hard disk and into RAM. SAM: SAM (Serial Access Memory) can be viewed as the direct opposite of RAM. Just like RAM, it stores a series of memory cells. The difference is that these cells can only be accessed in subsequent order, similar to a cassette tape. If the required data is not in the current cell, each subsequent cell is checked until the correct data is found. RAM data is not limited to these restrictions and can be accessed in any order. Sam is very effective with computer memory buffers, a situation where data is typically stored in the order in which it is intended to be used. An example of this would be a video card's texture buffer memory. DRAM: DRAM (Dynamic Random Access Memory) is the most widely used form of computer memory. It stores data for minimal amounts of time and needs to be refreshed regularly. DRAM is measured by ns (nanoseconds) and storage capacities in mb (megabytes). VRAM: VRAM (Video Random Access Memory) is another form of computer memory. As a version of fast-page memory, it is often found in vacs (video accelerator cards). Flash Memory: Flash memory is a re-writable memory chip that combines the functions of a hard drive and Random Access Memory. Even if power is lost, flash memory has the ability to retain the data. Flash memory offers many advantages such as low voltage, high speed and durability. You can find this type of memory in various devices including audio recorders, cell phones, digital cameras and printers. SRAM: Static Random Access Memory works in conjunction with other types of computer memory. When the machine boots up, a small set of instructions for starting the computer and displaying graphics are stored in Rom (Read Only Memory), more commonly known as Bios (Basic Input Output System). Because Rom tends to execute very slowly, Shadow RAM enables

the selected portions of Bios code to transfer from Rom to RAM, thus allowing data to be accessed much faster. 3. Discuss the significance of flag register employed by different microprocessor. Flag register is a brain of microprocessor. It is an 8 bit register which are set or reset after an operation according to data conditions of the result in the accumulator and other registers. In 8 bit register it has 5 flag in 5 bit and three bit are in dont care condition They are called Zero(Z), Carry (CY), Sign (S), Parity (P), and Auxiliary Carry (AC) flags; they are listed in the Table and their bit positions in the flag register are shown in the Figure below. The most commonly used flags are Zero, Carry, and Sign. The microprocessor uses these flags to test data conditions. For example, after an addition of two numbers, if the sum in the accumulator id larger than eight bits, the flip-flop uses to indicate a carry -- called the Carry flag (CY) -- is set to one. When an arithmetic operation results in zero, the flip-flop called the Zero(Z) flag is set to one. The flags are stored in the 8-bit register so that the programmer can examine these flags (data conditions) by accessing the register through an instruction. These flags have critical importance in the decision-making process of the microprocessor. The conditions (set or reset) of the flags are tested through the software instructions. For example, the instruction JC (Jump on Carry) is implemented to change the sequence of a program when CY flag is set. The thorough understanding of flag is essential in writing assembly language programs. A microprocessor is an integrated circuit that can be programmed to process data and send messages and directions to other electronic systems. They are the main features of computer processing systems. Flags are an important component of microprocessors as they register the outcomes of calculations and actions. The flags register maintains the current operating mode of the CPU and some instruction state information. The purpose of the FLAGS register is to indicate the status of the processor. It does this by setting the individual bits called flags. There are two kinds of FLAGS. Status FLAGS and Control FLAGS. Status FLAGS reflect the result of an operation executed by the processor. The control FLAGS enable or disable certain operations of the processor The flag register in 8085 is an 8-bit register which contains 5 bit positions. - These five flags are of 1bit F/F and are known as zero, sign, carry, parity and auxiliary carry. - For sign flag if the result of an MSB operation is 1 then it is set else it is reset. - The zero flag is set of the result of an instruction is zero. - The auxiliary carry flag is used for BCD operations, not free to the programmer. - The carry flag is used for carrying and borrowing in case of addition and subtraction operations. - The parity flag is used for results containing an even number of one's. The flag indicates the condition of the microprocessor as well as controls its operations. The carry, parity, zero, sign, and overflow flags are special because you can test their status (zero or

one) with the setcc and conditional jump instructions. The 80x86 uses these bits, the condition codes, to make decisions during program execution. Various arithmetic, logical, and miscellaneous instructions affect the overflow flag. After an arithmetic operation, this flag contains a one if the result does not fit in the signed destination operand. For example, if you attempt to add the 16 bit signed numbers 7FFFh and 0001h the result is too large so the CPU sets the overflow flag. If the result of the arithmetic operation does not produce a signed overflow, then the CPU clears this flag. Since the logical operations generally apply to unsigned values, the 80x86 logical instructions simply clear the overflow flag. Other 80x86 instructions leave the overflow flag containing an arbitrary value. The 80x86 string instructions use the direction flag. When the direction flag is clear, the 80x86 processes string elements from low addresses to high addresses; when set, the CPU processes strings in the opposite direction. The interrupt enable/disable flag controls the 80x86's ability to respond to external events known as interrupt requests. Some programs contain certain instruction sequences that the CPU must not interrupt. The interrupt enable/disable flag turns interrupts on or off to guarantee that the CPU does not interrupt those critical sections of code. The trace flag enables or disables the 80x86 trace mode. Debuggers (such as CodeView) use this bit to enable or disable the single step/trace operation. When set, the CPU interrupts each instruction and passes control to the debugger software, allowing the debugger to single step through the application. If the trace bit is clear, then the 80x86 executes instructions without the interruption. The 80x86 CPUs do not provide any instructions that directly manipulate this flag. The auxiliary carry flag supports special binary coded decimal (BCD) operations. Since most programs don't deal with BCD numbers, you'll rarely use this flag and even then you'll not access it directly. The 80x86 CPUs do not provide any instructions that let you directly test, set, or clear this flag. Only the add, adc, sub, sbb, mul, imul, div, idiv, and BCD instructions manipulate this flag. The parity flag is set according to the parity of the L.O. eight bits of any data operation. If an operation produces an even number of one bits, the CPU sets this flag. It clears this flag if the operation yields an odd number of one bits. This flag is useful in certain data communications programs, however, Intel provided it mainly to provide some compatibility with the older 8080 microprocessor. The carry flag has several purposes. First, it denotes an unsigned overflow (much like the overflow flag detects a signed overflow). You will also use it during multiprecision arithmetic and logical operations. Certain bit test, set, clear, and invert instructions on the 80386 directly affect this flag. Finally, since you can easily clear, set, invert, and test it, it is useful for various boolean operations. The carry flag has many purposes and knowing when to use it, and for what

purpose, can confuse beginning assembly language programmers. Fortunately, for any given instruction, the meaning of the carry flag is clear. 4. What are the different steps during the read cycle of memory? Step 1. Processor signals the memory to be read on to address bus. Step 2. Specific memory chips that hold the memory location are made ready. Step 3. Chip select is generated. Step 4. Delay is added to allow the memory to settle and to be available to read. Step 5. Data is placed on to the data bus. Step 6. Control unit turns on the read line on control bus. Step 7. Data is placed on to the (MDR) memory data registry 5. Discuss the use of serial interfaces in the communication.

A serial communications interface (SCI) is a device that enables the serial (one bit at a time) exchange of data between a microprocessor and peripherals such as printers, external drives, scanners, or mice. In this respect, it is similar to a serial peripheral interface ( SPI ). But in addition, the SCI enables serial communications with another microprocessor or with an external network. The term SCI was coined by Motorola in the 1970s. In some applications it is known as a universal asynchronous receiver/transmitter (UART). The SCI contains a parallel-to-serial converter that serves as a data transmitter, and a serial-toparallel converter that serves as a data receiver. The two devices are clocked separately, and use independent enable and interrupt signals. The SCI operates in a nonreturn-to-zero ( NRZ ) format, and can function in half-duplex mode (using only the receiver or only the transmitter) or in full duplex (using the receiver and the transmitter simultaneously). The data speed is programmable. Serial interfaces have certain advantages over parallel interfaces. The most significant advantage is simpler wiring. In addition, serial interface cables can be longer than parallel interface cables, because there is much less interaction (crosstalk) among the conductors in the cable. The term SCI is sometimes used in reference to a serial port. This is a connector found on most personal computers, and is intended for use with serial peripheral devices. 6. Discuss the areas of application where microprocessor technology is in use. The impact of microprocessor in different lures of fields is significant. The availability of low cost, low power and small weight, computing capability makes it useful in different applications. Now a days, a microprocessor based systems are used in instructions, automatic testing product, speed control of motors, traffic light control, light control of furnaces etc. Some of the important areas are mentioned below:

Instrumentation: it is very useful in the field of instrumentation. Frequency counters, function generators, frequency synthesizers, spectrum analyses and many other instruments are available, when microprocessors are used as controller. It is also used in medical instrumentation. Control: Microprocessor based controllers are available in home appliances, such as microwave oven, washing machine etc., microprocessors are being used in controlling various parameters like speed, pressure, temperature etc. These are used with the help of suitable transduction. Communication: Microprocessors are being used in a wide range of communication equipments. In telephone industry, these are used in digital telephone sets. Telephone exchanges and modem etc. The use of microprocessor in television, satellite communication have made teleconferencing possible. Railway reservation and air reservation system also uses this technology. LAN and WAN for communication of vertical information through computer network. Office Automation and Publication: Microprocessor based micro computer with software packages has changed the office environment. Microprocessors based systems are being used for word processing, spread sheet operations, storage etc. The microprocessor has revolutionize the publication technology. Consumer: The use of microprocessor in toys, entertainment equipment and home applications is making them more entertaining and full of features. The use of microprocessors is more widespread and popular. 7. Explain the difference between the following:

a. Microprocessor & Microcomputer. Answer: A microprocessor is a computer chip which executes instructions. It is part of a computer. A microprocessor is the heart of a microcomputer; it is the chip which does most of the processing, but other chips are required to make a whole computer work. A microcomputer is, well, a computer. It has a microprocessor, memory, I/O, etc There are three differences between microprocessor and microcomputer: 1. Microprocessor is one component of the microcomputer. 2. Microcomputer is a complete computer similar to any other computer. 3. The term peripheral is used for input/output devices. Peripheral: able to be attached to and used with a computer, though not an integral part of it.

b. Fetch & Execution cycle. Answer: FETCH The fetch part of the cycle starts by instructions being collected either from the hard-drive, the RAM, the cache or the registers. The way it knows which order to retrieve the instructions in is by each instruction being given a unique ID which are stored in a register so the control unit knows exactly what its looking for. (similar to how a computer has a unique IP Address on a network). EXECUTE After the correct instructions have been fetched the CPU will then interpret what the instruction is telling it to do then it will simply execute the instruction and the whole process will begin again until there are no more instructions or the computer is turned off. 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.

c. Instruction register & instruction format. Answer: The instruction register holds the current 10-bit instruction that specifies the current operation and operands/addresses. While Instruction format is represented as a binary value with specific format, called the instruction code It is made out of different groups of bits, with different significations: Opcode represents the operation to be performed (it is the instruction identifier) Operands one, two or three represent the operands of the operation to be performed A microprocessor can have one format for all the instructions or can have several different formats d. Assembler & Compiler. In general, compiler is a computer program that reads a program written in one language, which is called the source language, and translates it in to another language, which is called the target language. Traditionally, source language was a high level language such as C++ and target language was a low level language such as Assembly language. However, there are compilers that can convert a source program written in Assembly language and convert it to machine code or object code. Assemblers are such tools. So, both assemblers and compilers ultimately produce code that can be directly executed on a machine.

8. Discuss:

a. Role of clock in a Microprocessor. The role of clock in a microprocessor allows synchronization of several components of the microprocessor. The correctness of the computation of the microprocessor depends upon efficient and balanced distribution of the clock signal. The clock generator generates the clock signal. b. Role of instruction format. Describe a typical instruction format. The MIPS R2000/R3000 ISA has fixed-width 32 bit instructions. Fixed-width instructions are common for RISC processors because they make it easy to fetch instructions without having to decode. These instructions must be stored at word-aligned addresses (i.e., addresses divisible by 4). The MIPS ISA instructions fall into three categories: R-type, I-type, and J-type. Not all ISAs divide their instructions this neatly. This is one reason to study MIPS as a first assembly language. The format is simple. R-type instructions refer to register type instructions. Of the three formats, the R-type is the most complex. This is the format of the R-type instruction, when it is encoded in machine code. B31-26 opcode B25-21 B20-16 B15-11 B10-6 B5-0

register s register t register d shift amount function

I-type instructions
I-type is short for "immediate type". The format of an I-type instuction looks like: B31-26 opcode B25-21 B20-16 B15-0 immediate

register s register t

I-type instructions
I-type is short for "immediate type". The format of an I-type instuction looks like: B31-26 B25-21 B20-16 B15-0

opcode

register s register t

immediate

J-type instructions
J-type is short for "jump type". The format of an J-type instuction looks like: B31-26 opcode B25-0 target

We studied instruction format inn order to know the exact bits used for the immediate value. This makes decoding much quicker, and the hardware to handle instruction decoding that much simpler. c. Role of addressing mode. Addressing modes are an aspect of the instruction set architecture in most central processing unit (CPU) designs. The various addressing modes that are defined in a given instruction set architecture define how machine language instructions in that architecture identify the operand (or operands) of each instruction. An addressing mode specifies how to calculate the effective memory address of an operand by using information held in registers and/or constants contained within a machine instruction or elsewhere. d. Role of ROM in a microprocessor based system. The microprocessor can read from ROM, but it cant write to it or modify it. ROM is permanent. Often, ROM chips contain special instructions for the computer important stuff that never changes. The microprocessor can access information stored on a ROM chip whenever it needs to. The instructions are always there because theyre not erasable e. The difference between clock cycle, machine cycle & an instruction cycle. First off, computers use a clock. The frequency of this clock indicates how many (Giga/Mega/Kilo) cyles per second that the clock wave changes. This is the basis of any cycle for the computer. The machine cycle is the amount of cycles needed to do either a fetch, read or write operation. more here. The read or write may be more than a single bus cycle if the transaction between the CPU and memory is longer than the data width fetched or written. For example, on an 8080 machine, the data width is 8 bits. If the CPU needs to fetch or write 16 bits of data, that will require two bus cycles.

The instruction cycle is how many of these machine cycles are needed to complete an instruction. This varies depending on the instruction. For instance, some instructions after fetching them from memory need to fetch more data to complete the instruction, some need to write data at the end of the instruction cycle, some instructions don't do much at all, like the NOP, which basically fetches the instruction and does nothing for one machine cycle. f. The difference between hardware & software interrupts. A hardware interrupt is a signal created and sent to the CPU when an action by a device takes place. Example: key strokes and Mouse movements. A software interrupt is the same, but caused by software. Example: a timer may interrupt the cpu several times to keep the accurate time. g. Role of Stack. Stack is used largely during a function call but depending on the language and level of programming it may be used to temporarily store processor register data or other variables. Further, the stack may also be used for short-term large-scale storage of data when using recursive functions that store partial data in the stack and call themselves again. 9. Discuss the functions of the following signals of 8088.

a. RD READ: Read strobe indicates that the processor is performing a memory or I/O read cycle, depending on the state of the IO/M pin or S2. This signal is used to read devices which reside on the 8088 local bus. RD is active LOW during T2, T3 and Tw of any read cycle, and is guaranteed to remain HIGH in T2 until the 8088 local bus has floated. This signal floats to 3-state OFF in ``hold acknowledge''. b. ALE ADDRESS LATCH ENABLE: is provided by the processor to latch the address into an address latch. It is a HIGH pulse active during clock low of T1 of any bus cycle. Note that ALE is never floated. 10. What is the purpose of Program Counter in a microprocessor? The Program Counter (PC) is a register structure that contains the address pointer value of the current instruction. Each cycle, the value at the pointer is read into the instruction decoder and the program counter is updated to point to the next instruction. For RISC computers updating the PC register is as simple as adding the machine word length (in bytes) to the PC. In a CISC

machine, however, the length of the current instruction needs to be calculated, and that length value needs to be added to the PC. 11. Write three different methods to clear the accumulator. A.) mvi a, 00h B.) sub a C.) xra a 12. Why de-multiplexing of AD7- AD0 is required? If we demultiplex it , it can used as both address bus and data bus(only one at a time) depending upon the state of ALE. Demultiplexing means separation of address/data bus AD0-AD7 into address bus AD7AD0 and data bus D7D0. Microprocessor 8085 is having AD0AD7. Bus which is used for sending lower 8 bit address as well as data. During last clock cycle, address is transferred on these lines and data during 2nd clock cycle and 3rd clock cycle. Therefore during the 1st clock cycle lower address must be transferred on AD0AD7.

13. Explain the difference between a. High Level & Low Level Languages. The difference between them is on the way we write their code. For example, Assembly is a lowlevel language where the user writes code which is almost identical to the one computers understand (see below for more info). A high-level programming language uses a more natural and human-readable syntax which makes it easier for humans to understand and write. The problem with high-level languages is that the programmer doesn't exactly know how his code will be translated (compiled) into the code the computer understands, thus making it less powerful compared to the low level languages. Today, most programmers use some sort of a high-level language, because it is much easier to learn and understand and often requires much less work. b. Serial & parallel interfaces. The major difference between serial and parallel ports is that serial ports transfer data one bit at a time, while parallel ports can transfer data 8 bits at a time. Serial ports have to take apart the 8 bits in a byte, and transfer them one by one. On the other hand, the newer parallel ports line up the 8 bits and can transfer them all at once. Because serial ports can only transfer data one bit at a time, it's pretty obvious that they are much slower than the parallel ports that can transfer data eight bits at a time. However, serial ports are

also smaller and also require fewer wires. This is because parallel ports need eight wires to be able to transfer all eight bits at one time. Also, serial ports are much cheaper than parallel ports. 14. Why a microprocessor needs ROM & RAM memories? With Random Accesss Memory (RAM), the computer can read and write data at any of its Addresses (it is also called read/write memory or RWM). All data in this type of memory are lost when the power is turned off and is called volatile memory (an exception is designed where RAM is kept "alive" with a small battery). The second type of memory is read-only memory (ROM), which is similar to RAM except that new data cannot be written in; all data in ROM are loaded at the factory and cannot be changed by the computer. This memory does not lose its data when power is turned off and is called nonvolatile memory, Most microprocessor systems have both RAM and ROM. RAM is used for temporary program storage and as a temporary scratch pad memory for the CPU. ROM is used to store programs and data that need to be always available.

Вам также может понравиться