Download as pdf or txt
Download as pdf or txt
You are on page 1of 35

question only in diff order

c. Describe the major characteristics of RS232 and RS485 communication standard, and compare their diffe
rences. [
A finite state machine (FSM) or finite state automaton (plural: automata) is a model of behavior composed
of a finite number of states, transitions between those states, and actions.
All the memory segments, whether I/O pins, RAM, EPROM etc, could share a portion of the same address
block. Von-Neumann model does not distinguish between instructions and data: It allows the instructions t
o be stored in the same memory as data.

Von-Neumann Bottleneck: the speed/bandwidth of the connecting channels; read-write speed of the memo
ry and the speed of the communication bus.
How this architecture can overcome some of the problems associated with VonNeumann Architecture: allo
w simultaneous fetch of data and program, greater memory bandwidth than Von-Neumann, overcome bottle
neck problems in connecting channels between CPU
and memory

Modern use of Harvard architecture:


1. DSP processors
2. Microcontroller (e.g., AVR/ATMel processors)
4A
Please explain what semaphore is, and give out an example of using a semaphore for process synchronizati

on.
Semaphore is one of the earliest forms of fixed railway signals. These signals display their different indicati
ons to train drivers by changing the angle of inclination of a pivoted 'arm'.
Semaphore is simply a variable that is non-negative and shared between threads. A semaphore is a signalin
g mechanism, and a thread that is waiting on a semaphore can be signaled by another thread. It uses two ato
mic operations, 1)wait, and 2) signal for the process synchronization.
A semaphore either allows or disallows access to the resource, which depends on how it is set up.
Semaphores for mutual exclusion are a sub-category of all semaphores. They are used to block access to a r
esource, usually.

4b
Semaphore is a powerful tool for coordinating processes. However, it may create the deadlock and starvatio
n problems. Please explain what the starvation problem is and provide at least one solution to solve it.
Four condition of deadlock:

● Mutual exclusion: the resource involved is unshareable, such that the process would not be prev
ented to reuse the resource when necessary.
● Hold and wait or partial allocation: the process should hold the resources which are already bee
n allocated while waiting for other processes to finish. Thus, creates a deadlock condition.
● No pre-emption: the process should not have the resources taken away when the resource is stil
l in use. Hence the process waiting for the resource goes to deadlock condition.
● Circular Wait: the circular chain of the processes with every process holding the resource of the
next process in the chain. Hence, a circular wait condition prevails and all the processes goes to
the deadlock condition.


noise (random and uneven signal)

influence to D control: most affected by noise and disturbance, the derivative term is that it amplifies higher
frequency measurement or process noise that can cause large amounts of change in the output.

low-pass filter: low frequency signal can pass through


Filtering is often applied in control applications to dampen the effects of noise on a given process s
ignal. Filters – whether external or internal filters – effectively mute noise and smooth a controll
er’s response to dynamic behavior. Whereas internal filters manipulate data within the controller
and leave the raw signal unchanged, external filters are external to the PID controller and manipula
te the data going to the controller. These filtering options involve additional hardware and/or soft
ware cost. They may make it easier to estimate model parameters, but they also hide data that coul
d be important to the bigger picture – control.
//
Filter the measurements with a low-pass filter in order to remove higher-frequency noise compone
nts.

low pass filter: analog signal → frequency domain → remove noise

spikes of the frequency causes noise, so using the filter performs fourier transformation to find the
filtered frequency.
Moving software filter.

Which↓
• PWM - pulse width modulation
• control the speed of DC motor
• control the brightness of LED
Cut-off frequency
=1/(2piRC)?(not sure)
ADC. Converting analog signal to digital signal.

A7=0 B7=0 C3=1


A6=0 B6=0 C2=0
A5=1 B5=1 C1=1
A4=1B4=0
A3=1B3=0
A2=1B2=0
A1=1B1=0
(from “Embedded System Hardware” p.133-134) (file reference book)
Part A MC(add oil ahhhhhh!!

increase ki

2
full duplex, syn

0xf0
but cant run if it’s include , define can run
not meet user expectation?(u right!)
sda
SDA and SCL
+12 volts
差呢啲

You might also like