Embedded System - MidSem - Autumn2023 - Solution
Embedded System - MidSem - Autumn2023 - Solution
Q: 1 (a) Design a high-speed communication interface for a data transfer task that functions at
a speed of 1 Gbps (1 Gigabit per second). Determine the smallest number of bits needed,
encompassing data, start, and stop bits, to transmit a 16-byte packet using a UART
communication protocol. Additionally, explore potential obstacles in achieving these elevated
data rates.
Solution: The total number of bits required to transmit one byte is 10 (1 start bit + 8 data bits
+ 1 stop bit).
Total number of bits for a 16-byte packet = 16 bytes * 10 bits/byte = 160 bits
So, the minimum number of bits required to transmit a 16-byte packet using UART is 160 bits.
(b) Consider a UART configuration with one start bit, 1 stop bit, n data bits and no parity bits.
The bus operates at a frequency of 80 MHz Provide the relationship between baud rate (BR)
and maximum possible bandwidth (BW), assuming both are in bits/sec.
Solution: BW=n*BR/(n+2)
(c) From the given diagram observed at a receiver, calculate all the following UART
parameters:
(i) What is the data value transferred over the UART in hexadecimal?
Solution: 1001_0011 -> 0x93
(ii) What is the baud rate in bits/sec?
Solution: 1/5us = 200k bit/s
(iii) What is the maximum bandwidth in bytes per second?
Solution: 0.8*200/8 =20k byte/s
Solution: 0xFFFF8762
(b) Consider an Arduino with 10-bit ADC to read a voltage from a sensor. The Arduino is set
to reference the ADC with a 5V voltage range. If the sensor output voltage is 2.3V, what will
be the corresponding ADC value?
Solution: The ADC has a 10-bit resolution, which means it can represent values from 0 to
2^10 - 1 (from 0 to 1023). To find the ADC value corresponding to a voltage, we can use the
following formula:
So, the corresponding ADC value for a 2.3V input voltage is approximately 471.
(c) Consider an 8-bit ADC that has an input range of 0 to +10 volts and an output range of 0 to
255. Compute the output of ADC when an input of +7.5 volts is sampled? Give your answer
as a decimal number.
Solution: 256*7.5/10 = 192 or 255*7.5/10 = 191
Q: 3 (a) Consider the following 2-bit DAC using the R-2R configuration. The DAC is
controlled by
two output port pins, PE1 and PE0. Assume VOH is 3.0V and VOL = 0V.
(i) Compute the output current Iout when PE1 is high, and PE0 is low?
(ii) Compute is the output current Iout when PE1 is low, and PE0 is high?
(b) The below circuit shows the microcontroller is interfaced with multicolor LEDs through
7406 inverters and registers. Each color is controlled by a separate diode with an operating
point of 2V, 25mA.
Assume the VOL of the 7406 is 0.5V. Assume the microcontroller open circuit output voltage
ranges are VOH = 3.0V and VOL = 0.1V. Compute the values for the resistors needed.
Demonstrate equations of your calculations used to choose resistor values. Make individual
output control one color, positive logic.
Q: 4 (a) Explain working principle of Liquid crystal display and electromechanical relay.
(b) An embedded system intends to employ an ADC for the acquisition of electrocardiogram
(EKG) data. The human EKG's frequency spectrum extends from 0.1 Hz to 100 Hz. What is
the minimum sampling rate that would allow us to accurately represent the EKG in digital
samples? Express your response as the time interval between consecutive samples.
Solution: Nyquist Theorem says sampling rate needs to be larger than 2*fmax, so fs > 200 Hz,
which means the time between samples must be less than 1/200 = 5ms.