TAILIEUCHUNG - Hardware and Computer Organization- P5:

Hardware and Computer Organization- P5:Today, we often take for granted the impressive array of computing machinery that surrounds us and helps us manage our daily lives. Because you are studying computer architecture and digital hardware, you no doubt have a good understanding of these machines, and you’ve probably written countless programs on your PCs and workstations. | Chapter 5 timer 5 seconds NS yellow while timer 0 wait timer 20 seconds NS red EW green while timer 0 wait timer 5 seconds EW yellow while timer 0 wait Notice that there is a new wrinkle in this problem. The times are different. We are nominally in the N S state for 20 seconds and then if there is an EW car waiting we have to transition for 5 seconds through a yellow light before turning on EW green for 20 seconds. The statement while 1 is often used in embedded systems to identify the portion of the program code that will run forever. Once the system such as a printer is initialized the printer runs forever or until you turn off the power . Let s look at the state transition diagram shown in Figure . The state of the EW traffic sensor is an input to our algorithm and it can modify the behavior of the system. We can represent this condition by using the fact that there are two possible paths for the state machine to take once it is in the state NS GRN EW RED. As long as neither of the E W sensors detects a waiting car the traffic control algorithm will remain in this state. However if a waiting car is detected at the end of the time interval for NS GRN then the state machine transitions to the state NS YEL EW RED. Once in this state the algoritm must sequence through NS RED EW GRN and NS RED EW YEL before it re-enters the state NS GRN EW RED. There are no possible inputs in these other states that can change the sequence. Figure State transition diagram for the traffic intersection. 102 Introduction to State Machines Again assuming we could take care of the time requirements you could easily change the pseudo code of this algorithm to a real program in C or C . Of course we d need to supply an I O port to drive the lights and a timer mechanism but these are simple implementation details. Let s take a brief diversion from our algorithmic state machine design and introduce a new concept just when you thought it was safe to go back into the water bang . .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.