2016 Winter Model Answer Paper
2016 Winter Model Answer Paper
2016 Winter Model Answer Paper
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER– 16 EXAMINATION
Model Answer Subject Code: 17658
Important Instructions to examiners:
1) The answers should be examined by key words and not as word-to-word as given in the model answer
scheme.
2) The model answer and the answer written by candidate may vary but the examiner may try to assess the
understanding level of the candidate.
3) The language errors such as grammatical, spelling errors should not be given more Importance (Not
applicable for subject English and Communication Skills.
4) While assessing figures, examiner may give credit for principal components indicated in the figure. The
figures drawn by candidate and model answer may vary. The examiner may give credit for any equivalent
figure drawn.
5) Credits may be given step wise for numerical problems. In some cases, the assumed constant values
may vary and there may be some difference in the candidate’s answers and model answer.
6) In case of some questions credit may be given by judgement on part of examiner of relevant answer
based on candidate’s understanding.
7) For programming language papers, credit may be given to any other program based on equivalent
concept.
Page 1 of 28
] MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
b) Write c language program to toggle all bits of P0,P1,P2 and P3 ports continuously with certain delay.
Ans.(correct logic 4 marks)
#include <reg51.h>
void Add_delay (unsigned int);
void main (void)
4 No start and stop signals are Start and stop signals are
required required.
It is more
6 It is less reliable reliable
d) Draw the interfacing of 8x8 matrix keyboard with 89c51 microcontroller.- 4 marks
Ans:-
Page 3 of 28
] MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
#include<reg51.h>
void main()
{
unsigned char x;
while(1)
{
for(x=0x00; x,0x7f; x++)
{ P2=x:
}
for(x=0x7f; x<0x00; x--)
{ P2=x:
}
}
}
f) State any four design matrices of an embedded system.
Ans. (any four matrices - 1 mark each)
Processor power
Selection of the processor is based on the amount of processing power to get the job done and the register
width required.
8 bit, 16 bit, 32 bit and 64 bit microcontrollers are provided.
Processing power is different for different microcontrollers.
High clock, speed and addressing capable microcontrollers are available.
Very powerful DSPS are available for real time analysis of audio and video signals.
Memory
Designer has to make an estimate of the memory requirement and must make provision for expansion.
In a system, there are different types of memories : RAM, ROM, EPROM, PROM, etc.
Secondary storage devices like HDD can be embedded into the system like mobile.
Flash memory can be used instead of secondary memory. Hence, we can load NT in embedded system. E.g.
Embedded Linux OS can be loaded into wristwatches.
Operating system
Page 4 of 28
] MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Embedded system often reside in machines that are expected to run continuously for years without errors
and in some cases recover by themselves, if an error occurs.
So, the software is usually developed and tested more carefully than that for personal computers and
unreliable moving parts such as disk drives, switches or buttons are avoided.
Unit cost
The monetary cost of manufacturing each copy of the system, excluding NRE cost.
NRE cost
The monetary cost of designing the system. Once the system is designed, any number of units can be
manufactured without incurring any additional design cost (hence the term “non-recurring”).
Size
The physical space required by the system, often measured in bytes for software, and gates or transistors for
hardware.
Performance
The amount of power consumed by the system, which determines the lifetime of a battery, or the cooling
requirements of the IC, since more power means more heat.
Flexibility
The ability to change the functionality of the system without incurring heavy NRE cost. Software is
typically considered very flexible.
Time to market
The amount of time required to design and manufacture the system to the point the system can be sold to
customers.
Time to prototype
The amount of time to build a working version of the system, which may be bigger or more expensive than
the final system implementation, but can be used to verify the system’s usefulness and correctness and to
refine the system’s functionality.
Correctness
Our confidence that we have implemented the system’s functionality correctly. We can check the
functionality throughout the process of designing the system and we can insert test circuitry to check that
manufacturing was correct.
Safety
Page 5 of 28
] MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
a) Differentiate between Harvard and Von Neumann architecture with suitable diagram.
Ans: (any four points- 4 mks)
2 The Van Neumann architecture uses single The Harvard architecture uses physically separate
memory
Requires for their
single instructions
bus and data.
for instructions and data memories
Requires for their instructions
separate and data.
& dedicated buses for
3
memories for instructions and data.
4 Its design is simpler Its design is complicated
Page 6 of 28
] MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
5 Instructions and data have to be fetched in Instructions and data can be fetched
sequential order limiting the operation simultaneously as there is separate buses for
bandwidth. instruction and data which increasing operation
b)Draw the pin out of RS232 and describe the function DCE and DTE pins.
The RS-232 cable has two terminal devices namely Data Terminal Equipment (DTE) and Data communication
Equipment (DCE)
Both device will send and receive the signals.
The data terminal equipment is computer terminal and data communication is Modems or controllers etc.
The DTE transmits data on TXD and receives data from the DCE on RXD.
c)Write a C language program to read P2 and P3. Shift the bits of P2 to right by 2 bits and P3 to left by 4 bits.
Store the content of P2 to P0 and P3 to P1.
Ans. (correct logic 4 marks )
#include<regx51.h>
Void main(void)
{
Page 7 of 28
] MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
#include<regx51.h>
void delay();
void main()
{
int x;
for (x=0;x,13;x++)
{
P0=0x33;
delay(10);
P0=0x66;
delay(10);
P0=0xcc
delay(10);
P0=0x99;
delay(10);
}
}
void delay(unsigned int t)
{
unsigned int x,y;
for(x=0;x<=t;x++)
for(y=0;y<=1275;y++);
Page 8 of 28
] MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
f)What is inter task communication? Describe the different methods of inter task communication.
Ans (definition 1 mark, any three methods description- 3marks)
1) Intertask communication: Intertask communication involves sharing of data among task through sharing
of memory space, transmission of data etc. It is executed using following mechanism
1. Message queues
2. Pipe
3. Remote procedure calls
1) Message queues: A message queue is an object used for intertask communication through which task
send or receives messages placed in a shared memory. The queue may follow first in first out, last in first
out or priority sequence. Usually a message queue comprises of an associated queue control block, name,
Page 9 of 28
] MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
unique ID, memory buffer, queue length, maximum message length and waiting list. A message queue of
length 1 is called a mailbox.
2) Pipes: A pipe is an object that provides simple communication channel used for unstructured data
exchange among task. A pipe does not store multiple messages but stream of bits. Also data flow from a
pipe cannot be prioritized. There are two descriptors respectively at each end of the pipe for reading and
writing. Data is written in to the pipes an unstructured byte streamed via one descriptor and read from the
pipe in the FIFO order from the other.
3) Remote procedure call: It permits distributed computing where task can invoke the
execution of the another task on remote computer.
An in-circuit emulator (ICE) is a hardware device used to debug the software of an embedded system. It
was historically in the form of bond-out processor which has many internal signals brought out for the
purpose of debugging. These signals provided information about the state of the processor.
An in-circuit emulator provides a window into the embedded system. The programmer uses the
emulator to load programs into the embedded system, run them, step through them slowly, and view and
change data used by the system's software.
More recently the term also covers JTAG based hardware debuggers which provide equivalent
access using on-chip debugging hardware with standard production chips.
ICE’s attach a terminal or PC to the embedded system. The terminal or PC provides an interactive
user interface for the programmer to investigate and control the embedded system.
In usage, an ICE provides the programmer with execution breakpoints, memory display and
monitoring, and input/output control
b) Write C language program to read P0 and P1. Add the content of P0 and P1 and store the result to P2.
Ans. (correct logic 4 marks)
#include<reg51.h>
Void main(void)
{
Unsigned char a,b,c;
P0=0xFFH; //set port 0 as an input port
P1=0xFFH; //set port 1 as an input port
a=P0; //read number from port 0
b=P1; //read second number from port 1
c=a+b; //add both numbers
P2=c; //send result to port 2
}
i) IRDA-
Page 11 of 28
] MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
InfraRed (IrDA) is a serial half duplex, line of sight based wireless technology for data communications between
devices.
The remote control of TV, VCD players etc. works on the infrared data communication principle.
Infrared communication technique uses infrared waves of the electromagnetic spectrum for transmitting the data.
IrDA supports point-to-point and point-to-multipoint communication provided that all the devices involved in the
communication are within the line of sight.
The typical communication range for IrDA lies in the range 10 cm to 1 m. The range can be increased by increasing
the transmitting power of the IR device.
IR supports data rates ranging from 9600 bits/second to 16 Mbps.
IR is classified into Serial IR (SIR), Medium IR (MIR), Fast IR (FIR) depending on the speed of data transmission.
Page 12 of 28
] MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
d) Draw the interfacing of relay with 89C51 microcontroller. Write C language program to make relay on off
after certain delay.
Program
#include <reg51.h>
sbit relay =P2 0;
void ms_delay (unsigned int); //delay function
void main(void)
{
P2=0; //initialize port
while(1) //loop forever
{
relay=1; //relay is on
ms_delay(200); //delay
relay=0; //relay is off
ms_delay(200); //delay
}
}
void ms_delay (unsigned int itime)
{
unsigned int x,y;
for(x=0; x<itime; x++)
for (y=0; y<1275; y++);
}
e)List the classification of an embedded system and describe any 2 methods in brief.
Ans:- Classification- 2 mks, explain any 2 in brief – 1 mks each)
Page 13 of 28
] MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
1. Stand Alone Embedded Systems -Stand-alone embedded systems do not require a host system like a computer, it
works by itself. It takes the input from the input ports either analog or digital and processes, calculates and converts the
data and gives the resulting data through the connected device-Which either controls, drives or displays the connected
devices. Examples for the stand alone embedded systems are mp3 players, digital cameras, video game consoles,
microwave ovens and temperature measurement systems.
2. Real Time Embedded Systems -A real time embedded system is defined as, a system which gives a required o/p in
a particular time. These types of embedded systems follow the time deadlines for completion of a task. Real time
embedded systems are classified into two types such as soft and hard real time systems.
3. Networked Embedded Systems -These types of embedded systems are related to a network to access the
resources. The connected network can be LAN, WAN or the internet. The connection can be any wired or wireless.
This type of embedded system is the fastest growing area in embedded system applications. The embedded web
server is a type of system wherein all embedded devices are connected to a web server and accessed and controlled
by a web browser. Example for the LAN networked embedded system is a home security system wherein all
sensors are connected and run on the protocol TCP/IP
4. Mobile Embedded Systems-Mobile embedded systems are used in portable embedded devices like cell phones,
mobiles, digital cameras, mp3 players and personal digital assistants, etc. The basic limitation of these devices is the
other resources and limitation of memory.
5. Small Scale Embedded Systems -These types of embedded systems are designed with a single 8 or 16-bit
microcontroller that may even be activated by a battery. For developing embedded software for small scale
embedded systems, the main programming tools are an editor, assembler, cross assembler and integrated
development environment (IDE).
6. Medium Scale Embedded Systems -These types of embedded systems design with a single or 16 or 32 bit
microcontroller, RISCs or DSPs. These types of embedded systems have both hardware and software complexities.
Page 14 of 28
] MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
For developing embedded software for medium scale embedded systems, the main programming tools are C, C++,
and JAVA, Visual C++, and RTOS, debugger, source code engineering tool, simulator and IDE.
7. Sophisticated Embedded Systems-These types of embedded systems have enormous hardware and software
complexities, that may need ASIPs, IPs, PLAs, scalable or configurable processors. They are used for cutting-edge
applications that need hardware and software Co-design and components which have to assemble in the final
system.
Multicore Processor
It is an integrated circuit in which two or more processor s core have been packaged for enhanced
performance,reduced power consumtion and more efficient simultaneous multitasking.
In multi core technology architecture ,a single physical processor contains the core logic of two or more proessor
and these processors are packaged into a single integrated circuit.
Page 15 of 28
] MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
The multicore technology is mainly used for parallel computing which increases computer speed and efficiency.
Multiple processes are used in mobile devices, desktops, workstations and servers.
Multicore processors will give the benefits to all software especially for multithreaded program.
b). Write C language program to read P1 and store the one’s complement of P1 to P2.
Ans. (correct logic 4 marks)
#include<regx51.h>
void main(void)
{
unsigned char a,b,c;
P1=0xFFH; //set port 0 as an input port
P2=0x00FH; //set port 1 as an output port
a=P1; //read number from port 1
a=~a; //logical not operator
P2=a; //store one’s complement to port 2
}
Page 16 of 28
] MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Program:
include<reg51.h>
sbit CW_DIRECTION=P1^0; //P1.0 for Clock Wise direction
sbit CCW_DIRECTION=P1^1; //P1.1 for counter clockwise direction
void main(void)
{
CW_DIRECTION =0;
while(1)
{
//Motor OFF
CW_DIRECTION =1;
CCW_DIRECTION =0;
}
}
Page 17 of 28
] MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
(NOTE: Program may change. Student can also use the other logic e.g. Motor direction can be controlled based
on switch (connected to one one the port pins) status. Please check the logic and understanding of students.)
e)State two advantages and two applications of an embedded system.
Ans (each advantage and application 1 mark)
Application(any two)
Embedded systems play a vital role in our day to day life, starting from home to the computer industry, where most of
the people find their job for a livelihood.
1. Consumer electronics : Cam-coders, cameras, mp3 players, DVD players etc.
2. Household applications : Television, washing machine, fridge, microwave oven etc.
3. Home automation and security systems : Air conditioners, sprinklers, intruder detection alarms, fire alarms
etc.
4. Automotive industry : Antilock braking system, engine control, ignition systems, navigation system etc.
5. Telecom : Cellular telephones, handset multimedia applications.
6. Computer peripherals : Printers, scanners, fax machine etc.
7. Computer networking system : Network routers, switches, hubs, firewalls etc.
8. Healthcare : Different kind of scanners, ECG machines etc.
9. Measurement and instrumentation : Digital multi meters, digital CROs, logic analysers, PLS systems etc.
10. Banking and Retail : Automatic teller machines (ATM) and currency counters.
11. Card Readers : Barcode, smart card readers etc.
f) List the scheduling algorithm of RTOS .Describe any one scheduling algorithm in brief.
Ans: (State any four: 2 Marks, Explanation: 2M )
Page 18 of 28
] MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
6. Preemptive multitasking
Explanation: (any one of the following)
1. First in first out:
In first in first out scheduling algorithm the task which are ready to run are kept in queue and the cpu serves the task on
first in first served basis. this scheduling algorithm is shown in fig. is very simple to implement but not well suited for
most applications because it is difficult to estimate the amount of time a task has to wait for being executed . However
this is good algorithm for an embedded system has to perform few small tasks all with small execution time. If there is
no time critically and the number of tasks is small, this algorithm can be implemented
Time for coding More time is required for Less time required for
coding coding and code is more
efficient
Page 19 of 28
] MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
b) Write
C program to transfer 10 bytes from array A to array B.
c) Draw the interfacing of LCD display to 89C51 mic and describe the function of RS and RW pins.
Ans:-( Interfacing diagram- 2 mks, function- 1 mks each)
1) RS: RS is the register select pin used to write display data to the LCD (characters), this pin has to be high when
writing the data to the LCD. During the initializing sequence and other commands this pin should low.
Page 20 of 28
] MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
2)R/W: Reading and writing data to the LCD for reading the data R/W pin should be high (R/W=1) to write the data
to LCD R/W pin should be low (R/W=0)
e) State the meaning of the following terms: multitasking , shared data problem
Ans :- (2 marks each)
Multitasking
In computing, multitasking is the ability of an operating system to hold multiple processes in memory and switch
the processor from executing one process to another process is known as multitasking.
It creates the illusion of multiple tasks executing in parallel.
The act of switching of execution among multiple tasks is known as context switching.
In case of a system with a single processor, only one task is said to be running at any point in time, meaning that the
processor is actively executing instructions for that task.
Multitasking solves the problem by scheduling which task may be the one running at any time and when another
waiting task gets a turn T.
Even on computers with more than one processor (multiprocessor algorithm) multitasking allows many more tasks
to be run that a processors.
Page 21 of 28
] MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 22 of 28
] MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Deadlock: A deadlock, also called as deadly embrace, is a situation in which two threads are each unknowingly
waiting for resource held by other. Deadlock is the situation in which multiple concurrent threads of execution in a
system are blocked permanently because of resources requirement that can never be satisfied.
In this example, task #1 wants the scanner while holding the printer. Task #1 cannot proceed until both the printer and
the scanner are in its possession.
Task #2 wants the printer while holding the scanner. Task #2 cannot continue until it has the printer and the scanner.
Because neither task #1 nor task#2 is willing to give up what it already has, the two tasks are now deadlocked because
neither can continue.
a) Mutual exclusion- If we could arrange matters such that no two processes were ever in their
critical sections simultaneously, we could avoid race conditions. We need four conditions to
hold to have a good solution for the critical section problem (mutual exclusion).
1) No two processes may at the same moment inside their critical sections.
2) No assumptions are made about relative speeds of processes or number of CPUs.
3) No process should outside its critical section should block other processes.
4) No process should wait arbitrary long to enter its critical section.
Page 23 of 28
] MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
b) Hold & wait or resource holding- Hold and wait or resource holding: a process is currently
holding at least one resource and requesting additional resources which are being held by
other processes.
c) No preemption: a resource can be released only voluntarily by the process holding it.
d) Circular wait: a process must be waiting for a resource which is being held by another process,
which in turn is waiting for the first process to release the resource. In general, there is a set of
waiting processes,
P = {P1, P2, …, PN}, such that P1 is waiting for a resource held by P2, P2 is waiting for a
resource held by P3 and so on until PN is waiting for a resource held by P1.
PCI
1. Data transfer in PCI bus takes place according to a system clock. The first PCI by Intel supports 33 MHz maximum
clock rate, while the newer PCI buses now supporting maximum clock frequency of 66 MHz.
2. PCI implements a 32-bit multiplexed Address and Data bus (AD[31.0]). It architects a means of supporting a 64-bit
data bus through a longer connector slot, but most of today’s personal computers support only 32-bit data transfers
Page 24 of 28
] MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
through the base 32-bit PCI connector. At 33 MHz, a 32-bit slot supports a maximum data transfer rate of 132
Mbytes/sec. and a 64-bit slot supports 264 Mbytes/sec.
3. The multiplexed Address and Data bus allows a reduced pin count on the PCI connector that enables lower cost and
smaller package size for PCI components.
4. PCI supports a rigorous auto configuration mechanism. Each PCI device includes a set of configuration registers
that allow identification of the type of device (SCSI, Video Ethernet, etc.) and the company that produced it. Other
registers allow configuration of the device’s I/O addresses, memory addresses, interrupt levels, etc.
5. PCI defines support for both 5 volt and 3.3 volt signaling levels.
6. Although used most extensively in PC compatible systems, the PCI bus architecture is processor independent. PCI
signal definitions are generic allowing the bus to be used in systems based on other processor families.
PCI-X
PCI-X is a computer bus and expansion card standard that enhances the 32-bit PCI local bus for higher bandwidth
transmission.
It was originally created by IBM, HP and Compaq in the year 1998.
It is a double wide version of PCL, running at up to four times the clock speed but is otherwise similar in electrical
implementation and uses the same protocol.
It has been replaced by the similar PCI Express bus, with a completely different connector and a very different
logical design.
It provides number of slower connections in parallel but the new version PCI-Express gives single, narrow but fast
serial connection.
Clock speed of PCI-X is doubled from 66 MHz to 133 MHz.
Maximum possible bandwidth is 1064M Bits/sec.
Split transactions increase the efficiency.
d)Write C language program to generate a square wave of 2khZ on pin P1.1 by using timer 0 and
mode 1. Assume crystal frequency is 11.0592MHz
Ans. (correct logic 4 marks)
Crystal frequency= 11.0592 MHz
Fout = 2 KHz
Tout = 1/2 X 103
Tout = 500μ sec
Page 25 of 28
] MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Program
#include<reg51.h>
void delay(void);
sbit p=P1^5;
while (1)
p=~p;
delay();
void delay()
e)Draw the interfacing diagram of key and LED to 89C51 mic on pins P1.0 and P2.0 respectively. Write
a C language program to read the status of key and display it on LED.
Page 26 of 28
] MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Program
#include<reg51.h>
sw=1;
led=0;
if(sw==0) //if switch is closed on the led else off the led
led=1;
else
led=0;
} //end of while
} //end of main
Page 27 of 28
] MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
f) Write a C language program to transfer the message “MSBTE” serially at 9600 baud rate ,8 data bit
and 1 stop bit.
Ans: (04M for correct program with comments)
NOTE: Student may use another method for program any other correct method can be consider
#include <reg51.h>
void main(void)
{
unsigned char text[ ] = “MSBTE”; //initialize array
TMOD = 0x20; //Initialize timer 1 in mode 2
TH1 = 0xFD; //baud rate 9600
SCON = 0x50; //start serial communication ( 8bit , 1 stop bit , REN )
TR1 = 1; //start timer 1
for(i=0;i<6;i++) //Read array and transmit serially till end
{
SBUF = text[i];
while(TI==0); //check interrupt
TI = 0; //clear interrupt
}
}
Page 28 of 28