Professional Documents
Culture Documents
MM Assignmemt 1
MM Assignmemt 1
(ANSWERS)
1. Components:
Microprocessor (µP): Contains only the Central Processing Unit (CPU). It
memory, I/O, and other components. This complexity can lead to bulkier
designs.
Microcontroller: Simpler design as everything is on a single chip. This
process (CPU only). However, the need for additional external components
can increase the overall system cost.
Microcontroller: Slightly costlier due to the integration of multiple
functionalities on a single chip. But, since they eliminate the need for
external components, the overall system cost can be lower.
1|Page
4. Power Consumption:
Microprocessor: Higher power consumption because of the complexity
robots, toys, and industrial control systems where size, cost, and low power
consumption are important.
7. Scalability:
Microprocessor: More scalable. You can upgrade components like RAM
3|Page
X1 and X2: Input pins for an external crystal (or RC/LC network) that sets
the internal clock frequency. The frequency is divided by 2 internally.
CLK OUT: Output signal providing the system clock for devices connected
to the 8085.
5. Reset Signals:
RESET IN: Active LOW signal used to reset the microprocessor to its initial
state.
TRAP (non-maskable interrupt): Highest priority interrupt, cannot be
disabled by software.
6. DMA Signals (Optional):
DREQ (DMA Request): Input signal used by a Direct Memory Access
(DMA) controller to request control of the data bus.
DACK (DMA Acknowledge): Output signal acknowledging the DMA
request, granting control of the data bus to the DMA controller.
7. Serial Input/Output Ports (Optional):
SID: Serial Input Data used for receiving serial data.
SOD: Serial Output Data used for transmitting serial data.
4|Page
3. Draw the functional block diagram of internal
architecture of IC 8085 and explain it’s working. (7M)
8085 Microprocessor Functional Block Diagram and Explanation
Blocks:
1. Arithmetic Logic Unit (ALU):
o Performs arithmetic (addition, subtraction, etc.) and logical (AND, OR, etc.)
operations on 8-bit data.
o Receives data from the accumulator and registers.
o Sends the results back to the accumulator or other registers.
2. Accumulator (A):
o An 8-bit register that holds the main data operand for ALU operations.
o Most frequently used register in the 8085.
3. General Purpose Registers (B, C, D, E, H, L):
o Six 8-bit registers used for temporary data storage and addressing.
o Registers B and C, D and E, and H and L can be paired to form 16-bit
register pairs (BC, DE, and HL) for memory addressing.
4. Program Counter (PC):
o A 16-bit register that keeps track of the memory address of the next
instruction to be fetched.
o Incremented by the control unit after each instruction fetch.
5. Stack Pointer (SP):
o A 16-bit register that points to the top of the Last In, First Out (LIFO) stack
in memory.
o Used for subroutine calls, interrupt handling, and temporary data storage.
6. Control Unit (CU):
o Decodes instructions fetched from memory by the PC.
5|Page
o Generates control signals to coordinate data flow between various units
and memory.
o Manages the overall execution flow of the program.
memory.
Working:
1. The program counter (PC) fetches an instruction byte from memory.
2. The instruction is loaded into the instruction register (IR).
3. The control unit decodes the instruction and generates control signals.
4. Based on the instruction, data operands may be fetched from memory or
registers using the address bus and data bus.
5. The ALU performs the required arithmetic or logical operation on the data.
6. The result is stored back in the accumulator or another register.
7. The program counter is updated to point to the next instruction, and the
cycle repeats.
6|Page
4. Explain the following instruction with example. (4M)
1.ORI 32H
2. INX D
3. SBB B
1. ORI 32H
Instruction: OR Immediate (ORI)
Operation: Performs a logical OR operation between the Accumulator (A)
and an immediate operand (32H in this case).
Example:
o Let's assume the initial value in the Accumulator (A) is 4AH (hexadecimal
for 74 in decimal).
o When ORI 32H is executed, the bitwise OR operation is performed
between A (4AH) and 32H:
A 4A (decimal: 74) 0100 1010 (binary)
32H 32 (decimal: 50) 0011 0010 (binary)
-------------------------------------------------------------
Result 7EH (decimal: 126) 0111 1110 (binary)
7|Page
o The result (7EH) is stored back in the Accumulator (A), replacing its
previous value.
2. INX D
Instruction: Increment Register Pair (INX)
Operation: Increments the 16-bit value stored in the DE register pair by 1.
Example:
o Let's assume the initial value in the DE register pair is 2000H (hexadecimal
for 8192 in decimal).
o When INX D is executed, 1 is added to the DE register pair:
Initial DE: 2000H (decimal: 8192)
After INX D: DE = 2001H (decimal: 8193)
o The incremented value (2001H) is stored back in the DE register pair.
3. SBB B
Instruction: Subtract with Borrow (SBB)
Operation: Subtracts the content of register B from the Accumulator (A),
considering the Carry flag (CY) as a borrow.
Example:
o Let's assume the initial values are:
Accumulator (A): 5AH (decimal: 90)
Register B: 3BH (decimal: 59)
Carry flag (CY): 0 (not set)
o When SBB B is executed, the subtraction considers the borrow (CY):
Borrow (CY): 0 (not set)
A 5A (decimal: 90) 0101 1010 (binary)
-B 3B (decimal: 59) 0011 1011 (binary)
Borrow ----- (add 0 for no borrow)
----------------------------------------------------------------------------
Result 1F (decimal: 31) 0001 1111 (binary)
o The result (1FH) is stored in the Accumulator (A), replacing its previous
value.
o The Carry flag (CY) is set to 0 because the subtraction did not require
borrowing from the next higher-order bit.
8|Page
5. Explain architecture of the 8051 microcontroller.(7M)
The 8051 microcontroller, a popular 8-bit device, has a Harvard
architecture and features elements like a central processing unit (CPU),
memory, and input/output (I/O) ports. Here's a breakdown of its key
architectural components:
CPU:
Based on Reduced Instruction Set Computing (RISC) architecture for
efficiency.
8-bit data bus for processing 8-bit data at a time.
16-bit program counter to keep track of instructions in program memory.
Single accumulator, a special register for storing data during operations.
Memory:
Harvard architecture separates program and data memory.
4KB of on-chip ROM (Read-Only Memory) to store program instructions.
(Some variants may have EPROM or Flash memory)
128 bytes of on-chip RAM (Random-Access Memory) for data storage
during program execution.
Special Function Registers (SFRs) within the first 128 bytes of RAM for
controlling peripherals like timers and I/O ports.
I/O Ports:
Four 8-bit I/O ports (P0, P1, P2, and P3) for interfacing with external
devices.
Each port can be individually configured as input or output.
Port 1 has built-in pull-up resistors for input operations.
Other components:
16-bit timers/counters for timing and pulse-width modulation tasks.
Serial communication interface for data transmission and reception.
Interrupt controller to handle events and prioritize tasks.
9|Page
System Bus: A network connecting CPU, memory, I/O ports, and
peripherals using separate data, address, and control lines.
10 | P a g e