2012年11月26日星期一

Basic Input & Output Interface

After learning a lot about the structure and the function of pins in 8088, we begin to learn how it interface with other input and output. I feel 8088 is like a commander and he controls those sub-devices and coordinates them together to achive the goal.

As for a whole and brief look, the professor shows us the graph below, which describes how 8088 interface with peripheral devices and memory part.


But to write our own program to control it , we have to take a step further and learn more detailed knowledge about every part as well as the connection between them.

Input-output involves the transfer to (or from) peripheral devices from (or to) the data bus of the cpu; eg. data transfer to the CRT display, from the keyboard, to/from a hard-disk drive, to/from a modem to another computer system.

Input-output operations fall into one of the following types:

Programmed I/O - cpu polls peripherals to check if I/O is needed
Interrupt I/O - peripheral sends an interrupt request to cpu for I/O
Direct memory access (DMA) - peripheral writes directly to memory

The more detailed connection among each part is shown as below:

We can see from the graph  data Transfer between the I/O interface and the peripheral ca  involve either parallel or serial data transmission, depending on the peripheral and the actual implementation of the I/O interface.

Parallel data transfer involves using at least 8 separate lines for the 8 data bits in a byte. Normally, other lines are needed for the communications protocol (eg. STB [data strobe] line to indicate when data is valid, ACK line to acknowledge data has been read).

Serial data transfer involves sending the data on a single line, bitby bit. The I/O interface converts the data from parallel to serial or vice-versa using shift registers.

And there are 2 modes as for control the interface:

(1) Synchronous - data are sent in blocks, with start and end-of-block
markers. Individual characters within a block do not need start and stop
bits since the receiver identifies every 8 bits as one character, eg.

(2) Asynchronous - no block synchronization bits. Each character is identified by the start and stop bit(s) (stop bits can be 1, 1.5, 2 bits) inserted at the start and end of each character,eg.


It is really amazing that such a tiny chip can have so many functions, and we can even choose different modes to realize different goals. The graph below is a format for us to refer when we want to set different modes.


My own thinking about this course
As this course has ended in last week, I feel even though I still know little about the function and control of microprocessor, at least I have had a concept of it and known some basic operations.I still believe the best way to learn is to try it yourself. And the corresponding lab session gives us such a good chance.Making it out is really much much more difficult than knowing about it.That's why I spend a lot of time in lab session and I still find it hard.

Apart from the knowledge and experience I get, I begin to know the importance of cooperation and teamwork. Cooperation is important because without agreement and coordination we cannot accomplish what we need to do. Everyone must make sacrifices for the better if needed. To organize important ideas and events, cooperation must be obtained between groups of people to insure the job is done right and well.




2012年11月5日星期一

Data & Address Control in 8088

These weeks, we have learned more detailed knowledge about microprocessor. We focus on how the microprocessors control address and data and how these different microprocessors work together and achieve some purposes.


Actually, we use 8088--the most widely used microprocessor as an example to learn in detail.

The following graph is the picture of 8088 Fully Buffered Buses. We can see it can work in 2 different modes--Minimum mode and Maximum mode(as in the following picture, it works in minimum mode).Some buses are address buses and some are data buses and some are even can be used as both address and data buses, using multiplexing method.Information is transferred in both directions on the data bus - hence the data bus buffer must be bidirectional. A bidirectional buffer has a “direction”, which is controlled by (DIR) input.


We also learned the Basic 8086 System Timing(8086 is similar to 8088). Now, I can understand clearly how different pins work together and activate each other one by one in sequence by referring to the following diagram.

One special thing and difficult part to learn is about READY pin and WAITING. At first, I can't get the point and didn't know why it is needed and how it works. However, after reviewing the notes again and again and discussing with classmates and professor, I begin to get it and find it a really important and innovative design! The creative designer considered the situation that the access time for a memory device is longer than the memory
access time calculated,then we need to give extra clock periods, wait state
Tw, for memory, to guarantee the microprocessor works well. 
And we also see a macro-scope picture about how different microprocessors connect with each others and work together to achieve some purpose. We should not only know how a single microprocessor works, we also need to know the relationship between different microprocessors. Only in that way can we learn it well and use them properly and design our own system. 


Anyway, I feel this course is getting more and more difficult, but more and more interesting as well. There are a lot of scattered and seemingly unrelated knowledge that need to be learned and remembered. But what is more important, we have to be clear about those tedious information and put them in order and find out their relationship and regard it as a whole system. We have to build our own map about those pieces of knowledge. That like: knowledge is like pieces of bricks, what we should do is not only collect them, but using them to build our own houses!


Actually, my partner and I are trying to do a mini-project using the knowledge we have learned. We hope to make a smart car model which can follow the route automatically and even response to the change of the environment and give some information and tips about it. We have written down out proposal and drew the graph, and it is expected to be finished by the end of November.

This our design:
I hope we can make it out and make it even better than we expected!
We will try our best!

2012年10月16日星期二

Compared with Computer Networks,which makes the world a village

My previous article talks about a micro-scope look into the computer system based on the course called Microprocessor and Computer System.

 This week, I will talk about another aspect of computer system-- a macro-scope look at the networks around the world, as is shown below:


After attending this class, I'm surprised to find how the networks connect the world together. The most amazing concept is the layer model,which is shown below:

One of the best ways to visualize how all of the protocols interact on a particular host is to view it as a stack. A protocol stack shows how the individual protocols within the suite are implemented on the host. The protocols are viewed as a layered hierarchy, with each higher level service depending on the functionality defined by the protocols shown in the lower levels. The lower layers of the stack are concerned with moving data over the network and providing services to the upper layers, which are focused on the content of the message being sent and the user interface.



Different layers have different functions. And different protocols works on different layers to connect the world together and makes it a village.

I want to talk about some examples of famous protocols. IP protocol works on network layer, and is responsible for routing data along different path across the net. And TCP and UDP works on Transport layer. They two are different in the sense of the method they transmit data---TCP is connection-oriented, while UDP needs not to set up connection before transmission. Thus different working method result in different advantages and disadvantages. TCP is reliable, but setting up connection takes time; UDP is unreliable, although it can provide synchronization.

So, I begin to understand that there's no absolute and exact definition of what is good and what is bad. When we achieve some advantages, most of the time we have to give up something. Designing the product and writing proper program is actually a process that we maximize the advantages as well as make compromise to some disadvantages. The most important thing is to make decision according to what we really need and expect. When we think reliability is more important, such as for e-banking, we choose TCP; when we need synchronization, such as live broadcast, we use UDP.

This course also talks a lot on how our personal computer and the server interact with each other when we request some service. It relates tightly to our daily life. Since I'm really interested in it, I download a software called Wireshark to analyze and prove it using what I have learn in class.

We can see the software indeed captured a lot of protocols when I download some web pages, which is just the same as what I have learned. What is more, we can read many detailed information from this screen, and this process really gives me a better understanding about how the system works.

In later class, we have learned more detailed information about how the components that comprise internet work and provide us good service.  

For example, we take a closer look and analyze the different way to transmit segments or packets, such as Stop-and-Wait, Go-back-N, and Selective Repeat. We compare the complexity, the protocols, the efficiency of these 3 method. This makes me again realize the importance of improving the product or design repeatedly according to the demand.



Then, after comparing with the course--Computer Networks, I will talk what I have learned in the recent classes of Microprocessor.

First, I'll outline the content I learned as followed:

1. languages to program on the computer.
   Three levels of languages available to program a microprocessor: Machine Languages, Assembly Languages, and High-level Languages. 
    Machine Language
􀁠 A sequence of binary codes for the instruction to be executed by microcomputers.
􀁠 Long binary bits can be simplified by using Hexadecimal format.
􀁠 It is difficult to program and error prone.
􀁠 Different uP (micro-processor) uses different machine codes.
    Assembly Language
􀁠 To simplify the programming, assembly language (instead of machine language) is
used.
􀁠 Assembly language uses 2- to 4-letter mnemonics to represent each instruction
type. E.g. “Subtraction” is represented by SUB
􀁠 Four fields in assembly language statement:
Label, OP Code, Operand and Comment fields.
􀁠 Programs will be ‘translated’ into machine language, by Assembler, so it can be loaded into memory for execution.
    High-Level Language
􀁠 High level languages, like C, Basic or Pascal, can also be used to program
microcomputers.
􀁠 An interpreter or a compiler is used to ‘translate’ high level language statement to
machine code.
􀁠 High level language is easier to read by human and is more suitable when the
programs involves complex data structures.

2.Different  Addressing Mode
8088 for memory retrieval and storage.
􀁠Register addressing mode,
􀁠Immediate addressing mode,
􀁠Direct addressing mode,
􀁠register indirect addressing mode,
􀁠Based addressing mode,
􀁠Indexed addressing mode,
􀁠Based indexed addressing mode,
􀁠String addressing mode, and
􀁠Port addressing mode.

So, just as what I have said before, this course is really looking into very detailed part and structures about computer system and computer hardware.

We have to not only understand something like addressing modes, how computers transmit information as bits,how computers store information(shown in the graph above) and so on but as well as remember many assembly orders, address default values to make ourselves more familiar with it.

In addition, we should make good use of Google and Wikipedia to get more information, like pins' functions of microprocessors and block diagrams as shown bellow:

Anyway, I'm interested in both courses, one is more about macro-scope, the other is about micro-scope!


2012年9月23日星期日

Microprocessors & Computer system----Looking into the Computer

This term I have chosen several classes about computer, such as "Computer networks" and  "Microprocessors and Computer system".The former one focuses on a macro-scope of the computer system around world and the latter one is more about the basic structures of individual computer.

This week, I will talk about my feelings and opinions on "Microprocessors and Computer system" first.

This course is based on the study of a widely used microprocessor--Intel 8086.It's appearance is as below:

















(The pin graph of 8086 )


And we learned the basic functions of each pin and how it works to implement some basic operation,such as reading and writing.I'm surprised to find that every seemingly simple action actually needs many steps to implement,and only when every part of the processor cooperates well can it accomplished the operation.
Knowing how the computer works step by step is interesting an amazing.
(The basic steps of how processors work)


I used to think I'm familiar with the computer since I use it every day.But now I know that it's not that simple.Many efforts have been made by thousands of engineers and scientists and many complex methods have been used to design a computer to provide us, the users a really simple and friendly using experience.Many times,the more seemingly simple product actually is the result of more efforts.

So, I begin to know that the essential work done by engineer is not only about those complicated math and physics, but more about how to encapsulate those difficult things into easy and friendly products or designs.

This course even reminds me of the slogan of Philips,that is "Complicated the mind,simple the action".Now,I have a deeper understanding about it after taking this course.I've made up my mind that I would try to learn more not only about the principles and basic theories about engineering,although they are of great importance,I would also try to obtain more understanding and experiences about how to design and improve the function of products in real life.