0% found this document useful (0 votes)
40 views3 pages

Computer Multitasking Real-Time Computing

This document contains a microprocessors final exam for computer engineering students. It includes 10 questions testing knowledge of microprocessor registers, interrupts, communication protocols like I2C, USART and SPI, differences between USART and SPI, clock synchronization, clock arbitration, assembly code to check for divisibility by 4, address decoding, memory address generation for the 8086 microprocessor involving code, data and stack segments.

Uploaded by

Alazar DInberu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views3 pages

Computer Multitasking Real-Time Computing

This document contains a microprocessors final exam for computer engineering students. It includes 10 questions testing knowledge of microprocessor registers, interrupts, communication protocols like I2C, USART and SPI, differences between USART and SPI, clock synchronization, clock arbitration, assembly code to check for divisibility by 4, address decoding, memory address generation for the 8086 microprocessor involving code, data and stack segments.

Uploaded by

Alazar DInberu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Microprocessors final exam for computer engineering regular students

1. What are the three registers which control the I/O ports and explain their use briefly? (6 Marks)
2. What do you know about interrupts and its use? (5 Marks)

Interrupts are commonly used by hardware devices to indicate electronic or physical state
changes that require attention. Interrupts are also commonly used to implement computer
multitasking, especially in real-time computing. Systems that use interrupts in these ways are
said to be interrupt-driven.[2]

3. Briefly explain the following communication protocols and give concrete example of their use?
(24 Marks)
A. I2C

 Stands for Inter-integrated-circuit (I2C)


 It is a serial communications protocol similarly to UART but not used for PC-device
communication but are used with modules and sensors.
 It is a simple, bidirectional two-wire synchronous serial bus and require only two wires to
transmit information between devices connected to the bus.
 They are useful for projects that require many different parts (eg. sensors, pin,
expansions and drivers) working together as they can connect up to 128 devices to the
main board while maintaining a clear communication pathway!
 It is as I2C uses an address system and a shared bus = many different devices can be
connected using the same wires and all data are transmitted on a single wire and have a
low pin count. However, the tradeoff for this simplified wiring is that it is slower than SPI.
 Speed of I2C is also dependent by data speed, wire quality and external noise
 The I2C protocol are also used for two-wire interface to connect low-speed devices like
microcontrollers, EEPROMs, A/D and D/A converters, I/O interfaces and other similar
peripherals in embedded systems.

B. USART

 Stands for Universal Asynchronous Reception and Transmission (UART)


 Simple serial communication protocol that allows the host communicate with the
auxiliary device.
 UART supports bidirectional, asynchronous and serial data transmission.
 It has two data lines, one to transmit (TX) and another to receive (RX) which is used
to communicate through digital pin 0, digital pin 1.
 TX and RX are connected between two devices. (e.g. USB and computer)
 UART can also handle synchronization management issues between computers and
external serial devices.

C. SPI

 Stands for Serial Peripheral interface (SPI)


 It is similar to I2C and it is a different form of serial-communications protocol specially
designed for microcontrollers to connect.
 Operates at full duplex where data can be sent and received simultaneously.
 Operate at faster data transmission rates = 8Mbits or more
 It is typically faster than I2C due to the simple protocol. Even if data/clock lines are
shared between devices, each device will require a unique address wire.
 Used in places where speed is important. (e.g. SD cards, display modules or when info
updates and changes quickly like thermometers)

D. Parallel streaming
4. USART and SPI both are serial communication protocols, what is their main difference? (2 Marks)
USART is hardware - Universal Synchronous Asynchronous Receive &
Transmit Engine.
No fixed protocol (7,8 or 9 bit with or without Receiver Addressing) but is
normally capable of protocols that incorporate:
Asynchronous - usually RS232, RS422 & RS485 - two wires TX & RX with pre-
defined data rate and receiving synchronized to incoming data stream. No
pre-defined master or slave and may be full duplex.
Synchronous - two wires, fixed Clock (from single master) and Data - half-
duplex - 8 or 9 bit & no slave address

SPI is a communication protocol - normally a three wire, synchronous, single


master, multi-slave & duplex system. Wires are Master-Clock, Data in, Data
Out & Slave Select(n).
5. Briefly explain the following terms (6 Marks)
A. Clock synchronization
Clock synchronization is a topic in computer science and engineering that aims to
coordinate otherwise independent clocks. Even when initially set accurately, real clocks
will differ after some amount of time due to clock drift, caused by clocks counting time at
slightly different rates. There are several problems that occur as a result of clock rate
differences and several solutions, some being more appropriate than others in certain
contexts.[
B. Clock arbitration

Several I2C multi-masters can be connected to the same I2C bus and operate
concurrently. By constantly monitoring SDA and SCL for start and stop
conditions, they can determine whether the bus is currently idle or not. If the bus
is busy, masters delay pending I2C transfers until a stop condition indicates that
the bus is free again.
However, it may happen that two masters start a transfer at the same time.
During the transfer, the masters constantly monitor SDA and SCL. If one of them
detects that SDA is low when it should actually be high, it assumes that another
master is active and immediately stops its transfer. This process is
called arbitration.
6. Write the segment of assembly code which can check whether the number is divisible by 4 or
not? (5 Marks)
7. Briefly explain address DE multiplexing of 8085 and 8086 microprocessors
and its advantages?
8. Briefly explain the memory address generation of 8086? And why we need it?

a. Code segment and instruction pointer

- Code segment register (CS): is used for addressing memory location in the code
segment of the memory, where the executable program is stored.

- Instruction pointer The IP is also 16-bits in length and identifies the location of the
next word of instruction to be fetched from the current code segment of memory. It

contains the offset of the next word of instruction code.

b. Data segment and source index

- Data segment register (DS): points to the data segment of the memory where the
data is stored.

c. Stack segment and stack pointer

9. If the data segment address is 0x5CA2, and source index address is 0xAE9C, calculate the
physical address of the memory?
10. Among the five status flags, which are set to 1 when the following program runs? (3 Marks)

You might also like