Showing posts with label Microprocessor. Show all posts

Describe SAP-1 architecture

The SAP (Simple-As-Possible) computer has been designed for beginners. The main purpose of SAP is to introduce all the crucial ideas behind computer operation without burying you in unnecessary detail. SAP-1 is the first stage in the evolution toward modern computers. SAP-1 is a big step for beginners.
 1.      Program Counter
The program is stored at the beginning of the memory with the first instruction at binary address 0000, the second instruction at 0001, the third at address 0010 and so on. The program counter which is part of the control unit, counts from 0000 to 1111. Its job is to send to the memory the address of the next instruction to be fetched and executed. It does this as mentioned in the next paragraph.
      The program counter is reset to 0000 before each computer run. When the computer run begins, the program counter sends the address 0000 to the memory. The program counter is then incremented to get 0001. After the first instruction is fetched and executed, the program counter sends address 0001 to the memory. Again the program counter is incremented. After the second instruction is fetched and executed, the program counter sends address 0010 to the memory. So this way, the program counter keeps track of the next instruction to be fetched and executed.
      The program counter is like someone pointing a finger at a list of instructions saying do this first, do this second, do this third, etc. This is why the program counter is called a pointer; it points to an address in memory where the instruction or data is being stored.

2.      Input & MAR
The Input and MAR includes the address and data switch registers. Switch registers are part of input unit, allows us to send 4 address bits and 8 data bits to the RAM.
The memory address register (MAR) is the part of SAP-1 memory. During a computer run, the address in the program counter is latched in to the MAR. A bit later, the MAR applies this 4-bit address to the RAM where a read operation is performed.

3.      The RAM
The RAM is a 16 X 8 static TTL RAM. We can program the RAM by means of the address and data switch registers. This allows you to store a program and data in the memory before a computer run.
During a computer run, the RAM receives 4-bit addresses from the MAR and a read operation is performed. In this way, the instruction or data word stored in the RAM is placed on the W bus for use in some other part of the computer.
4.      Instruction Register
The instruction register is the part of the control unit. To fetch an instruction from the memory the computer does a memory read operation. This places the contents of the addressed memory location on the W bus. At the same time, the instruction register is set up for loading on the next positive clock edge. The content of the instruction register are split into two nibbles. The upper nibble goes directly to the block “Controller – Sequencer”. The lower nibble is read onto the W bus when needed.

5.      Controller – Sequencer
Before each computer runs, a CLR signal is sent to the program counter and CLK signal to the instruction register. This resets the program counter to 0000 and wipes out the last instruction in the instruction register.
      A clock signal CLK is sent to all buffer registers; this synchronizes the operation of the computer ensuring that things happen when they are supposed to happen.
      The 12 bits that come out of the controller sequencer form a word controlling the rest of the computer (like a supervisor telling others what to do). The 12 wires carrying the control word are called the control bus. The control word has the format of: CON = CP EP LM CE   L1 E1 LA EA   SUEULBLO
      This word determines how the registers will wait to the next positive CLK edge. For example, a high EP and a low LM means that the program counter are latched into the MAR on the next positive clock edge. As another example, a low CE and a low LA means that the addressed RAM word will be transferred to the accumulator.

6.      Accumulator
The accumulator (A) is a buffer register that stores intermediate answers during a computer run. Accumulator has two outputs, one directly goes to the adder-subtractor and the other goes to the W bus.

7.      The Adder – Subtractor
SAP-1 uses a 2’s complement adder-subtractor. When SU is low, the sum out of the adder-subtractor is S = A + B. When SU is high, the difference appears as A = A + B ’.

8.      B Register
The B register is another buffer register. It is used in arithmetic operations. A low LB and positive clock edge load the word on the W bus into the B register. The two state output of the B register drives the adder-subtractor, supplying the number to be added or subtracted from the content of the accumulator.
9.      Output Register
At the end of the computer run, the accumulator contains the answer to the problem being solved. At this point, we need to transfer the answer to the outside world. This is where the output register is used.
      When EA is high and LO is low, the next positive clock edge loads the accumulator content to the output register. The output register is often called an output port because the processed data can leave the computer through this register.

10.  Binary Display
The binary display is a row of eight light emitting diodes (LED’s). Because each LED connects to one flip-flop of the output port, the binary display shows us the content of the output port. Therefore, after we transferred an answer from the accumulator to the output port, we can see the answer in binary form.
Learn more »

Write an assembly program to find greatest between two numbers

Program
                        MVI B, 30H
                        MVI C, 40H
                        MOV A, B
                        CMP C
                        JZ EQU
                        JC GRT
                        OUT PORT1
                        HLT
              EQU: MVI A, 01H
                       OUT PORT1
                       HLT
              GRT: MOV A, C
                       OUT PORT1
                       HLT
Learn more »

What are the different addressing modes in 8085?

The instructions MOV B, A or MVI A, 82H are to copy data from a source into a
destination. In these instructions the source can be a register, an input port, or an 8-bit
number (00H to FFH). Similarly, a destination can be a register or an output port. The
sources and destination are operands. The various formats for specifying operands are
called the ADDRESSING MODES. For 8085, they are:
1. Immediate addressing.
2. Register addressing.
3. Direct addressing.
4. Indirect addressing.
Immediate addressing
Data is present in the instruction. Load the immediate data to the destination provided.
Example: MVI R,data

Register addressing
Data is provided through the registers.
Example: MOV Rd, Rs

Direct addressing
Used to accept data from outside devices to store in the accumulator or send the data
stored in the accumulator to the outside device. Accept the data from the port 00H and
store them into the accumulator or Send the data from the accumulator to the port
01H.
Example: IN 00H or OUT 01H

Indirect Addressing
This means that the Effective Address is calculated by the processor. And the
contents of the address (and the one following) is used to form a second address. The
second address is where the data is stored. Note that this requires several memory
accesses; two accesses to retrieve the 16-bit address and a further access (or accesses)
to retrieve the data which is to be loaded into the register.
Learn more »

What are the differences among EPROM, EEPROM, and flash memory?


  1. EPROM is read and written electrically; before a write operation, all the storage cells must be erased to the same initial state by exposure of the packaged chip to ultraviolet radiation. Erasure is performed by shining an intense ultraviolet light through a window that is designed into the memory chip.  

    EEPROM is a read- mostly memory that can be written into at any time without erasing prior contents; only the byte or bytes addressed are updated. 

     Flash memory is intermediate between EPROM and EEPROM in both cost and functionality. Like EEPROM, flash memory uses an electrical erasing technology. An entire flash memory can be erased in one or a few seconds, which is much faster than EPROM. In addition, it is possible to erase just blocks of memory rather than an entire chip. However, flash memory does not provide byte-level erasure. Like EPROM, flash memory uses only one transistor per bit, and so achieves the high density (compared with EEPROM) of EPROM.
Learn more »

What is difference between Microprocessor and Microcontroller?

The difference between Microprocessor and Micro-controllers are tabulated below:

Criteria

Microprocessor

Micro-controllers

Hardware architecture
Microprocessor is a single-chip CPU

Microcontrollers contains, in a singles IC, a CPU and much of remaining circuitry of a complete microcomputer system, like RAM, ROM,a serial interface, a parallel interface, timer, and interrupt scheduling circuitry all within in the same IC.
Applications
Microprocessors are most commonly used as the CPU in microcomputer systems. They are suited to processing information in computer systems.

Microcontrollers are found in small,
minimum-component designs control-oriented activities.
performing
They are suited to control of I/O devices in designs requiring minimum component count.
Instruction set features
Instruction sets are processing intensive  implying they have powerful addressing  modes with instructions catering to operations on large volumes of data. Their instructions operate on bytes, words and double words. Addressing modes provide access to large arrays of data, using address pointers and offset.

Microcontrollers have instruction sets catering to the control of inputs and outputs.
Microcontrollers have instructions to set and clear individual bits and perform other bit- oriented operations such as logically ANDing, ORing or XORing bits.
The instructions are highly compact. The majority of instructions are implemented in a single byte.
Examples
8086, 80286 . . .

8048, 8051 . . .
Learn more »

Microprocessor 8085, 8086 and 8088 programming (Assembly Language Programming)

1. Write a program to transfer 03H in register B and 04H in register C. Transfer the content of C to D and add the content of B and D.
ans:=>
           MVI B,03H
           MVI C,04H
           MOV D,C
           ADD B
           HLT -->
Learn more »