Engineering 代写:Real Time System Design ECE5881 代写案例

实时系统是指系统受制于实时性,即应保证在指定的时间约束内响应或系统应满足指定的期限。例如飞行控制系统、实时监视器等。

基于时序约束的实时系统类型:

硬实时系统:这种类型的系统永远不会错过它的最后期限。错过最后期限可能会带来灾难性的后果。硬实时系统产生的结果的有用性会突然降低,如果迟到增加,可能会变成负数。迟到是指实时系统在截止日期前完成任务的时间。示例:飞行控制器系统。

软实时系统: 这种类型的系统偶尔会以可接受的低概率错过最后期限。错过最后期限不会造成灾难性后果。软实时系统产生的结果的有用性随着迟到的增加而逐渐降低。示例:电话交换机。

实时系统的特点

  1. 时间限制:
    与实时系统相关的时间限制仅仅意味着为正在进行的程序的响应分配的时间间隔。这个期限意味着任务应该在这个时间间隔内完成。实时系统负责在其时间间隔内完成所有任务。
  2. 正确性:
    正确性是实时系统的突出部分之一。实时系统在给定的时间间隔内产生正确的结果。如果在给定的时间间隔内没有获得结果,那么结果也被认为是不正确的。在实时系统中,结果的正确性就是在时间约束下得到正确的结果。
  3. 嵌入式:
    所有实时系统现在都是嵌入式的。嵌入式系统是指为特定目的而设计的硬件和软件的组合。实时系统从环境中收集数据并传递给系统的其他组件进行处理。
  4. 安全性:
    任何系统都需要安全性,但实时系统提供关键安全性。实时系统也可以长时间运行而不会出现故障。当系统发生故障时,它也很快恢复,并且不会对数据和信息造成任何损害。
  5. 并发性:
    实时系统是并发的,这意味着它可以一次响应多个进程。系统内有几个不同的任务,它会在短时间内对每个任务做出相应的响应。这使得实时系统成为并发系统。
  6. 分布式:
    在各种实时系统中,系统的所有组件都以分布式的方式连接起来。实时系统以不同的组件位于不同的地理位置的方式连接。因此,实时系统的所有操作都以分布式方式操作。
  7. 稳定性:

即使负载非常重,实时系统也会在时间限制内做出响应,即实时系统不会延迟任务的结果,即使同时有多个任务在进行。这带来了实时系统的稳定性。

Real Time System Design 代写案例

Question 1

Refer to the following real time systems C code based on the operating system uC/OS-II used in the laboratory.

void Task1(void *pData){
int A = 0;
while (1){
A++;
OSSemPost(sem);
OSSemPost(sem);
OSDelay(3);
}
} // Task1
void Task2(void *pData){
int B = 0;
while (1){
B++;
OSSemPend(sem);
OSDelay(2);
}
} // Task2
void Task3(void *pData){
int C = 0;
while (1){
C++;
OSSemPend(sem);
OSDelay(1);
}
} // Task3

Recall that the OSDelay(num) system call will block the current task until the next num timer interrupts have occurred. Recall also that the OSSemPost(sem) and OSSemPend(sem) system calls correspond to signal and wait on the semaphore sem respectively. Assume the following:

• The semaphore sem is initialised to 1 before any of the three tasks run.
• Task1 is the highest priority task and is created with priority 1.
• Task2 is created with priority 2 and Task3 with priority 3.
Page 3 of 12
• The execution time of each statement is much shorter than the time between the system
timer interrupts.
• Time 0 refers to the starting of execution and scheduling of the three tasks.
• The system timer interrupt occurs once every millisecond.
• Time 10 refers to 10 milliseconds after time 0.

Q1.1
Which task will be scheduled to run first at time 0?

Q1.2
Which task is scheduled 2nd and at what time?

Q1.3
Which task is scheduled 3rd and at what time?

Q1.4
What value would you expect to see in the variable A after one second has elapsed since starting of
the execution and scheduling of the three tasks?
A =

Q1.5
Which task first blocks on the semaphore sem?
What time does this occur?

Question 2

This question refers to the following real time system C code that is a first attempt to solve the problem of synchronising two tasks using a single function, Synch().

void Synch(void){
// Synch() attempts to synchronise two tasks, each calling this function.
// The earlier task should then wait until the later one calls this function before
// proceeding.
static bool first = true;
if (first){
OSSemPend(sem_synch);
first = false;
} else {
OSSemPost(sem_synch);
first = true;
}
} // Synch

Question 3

In the Bus Communication Lab, you interfaced a peripheral with four 16 bit registers to the bus bridge with a data width of 16 bits. Recall that the bus bridge produces 19 bits of address and 2 bits of byte_enable.

contact

Assignment Exmaple

Recent Case

Service Scope

C|C++|Java|Python|Matlab|Android|Jsp|Prolo
g|MIPS|Haskell|R|Linux|C#|PHP|SQL|.Net|Hand
oop|Processing|JS|Ruby|Scala|Rust|Data Mining|数据库|Oracle|Mysql|Sqlite|IOS|Data Mining|网络编程|多线程编程|Linux编程操作系统|计算机网络|留学生|编程|程序|代写|加急|个人代写|作业代写|Assignment

Wechat:maxxuezhang

wechat