EEC 214 Lecture 1
EEC 214 Lecture 1
EEC 214 Lecture 1
Computer Microprocessor
Lecture 1
Class Information
Class meets:
Saturday (Lecture)
Thursday(Laboratory)
Instructor:
Dr. Mohamed A. Torad
Mohamed.torad@gmail.com
2nd Edition
1 Introduction to Computing 5 2 - 3
2 The AVR Microcontroller: History and Features 5 2 - 3
3 AVR Architecture and Assembly Language 5 2 - 3
Programming
4 Branch, Call, and Time Delay Loop 5 2 - 3
5 AVR I/O Port Programming 5 2 - 3
6 Arithmetic, Logic Instructions, and Programs 5 2 - 3
7 AVR Advanced Assembly Language 5 - - 3
Programming
8 AVR Programming in C 5 2 - 3
9 AVR Hardware Connection, Hex File, and Flash 5 2 - 3
Loaders
10 AVR Timer Programming in Assembly and C 5 2 - 3
11 AVR Interrupt Programming in Assembly and C 5 2 - 3
12 AVR Serial Port Programming in Assembly and 5 2 - 3
C
Computer Microprocessor Dr. Mohamed A. Torad 5
13 LCD and Keyboard Interfacing 5 2 - 3
Polices- Academic Honesty
Logic gates
Address bus
The number of locations is always equal to , where x is the number of address lines, regardless
of the size of the data bus. For example, a CPU with 16 address lines can provide a total of
65,536 ( ) or 64K of addressable memory. Each location can have a maximum of 1 byte of
data. This is because all general-purpose microprocessor CPUs are what is called byte
addressable.
For example, an article in a technical journal may state that the 128M chip has become popular.
In that case, it is understood, although it is not mentioned, that 128M means 128 megabits since
the article is referring to an IC memory chip. However, if an advertisement states that a computer
comes with 128M memory, it is understood that 128M means 128 megabytes since it is referring
to a computer system.
Memory organization
Memory chips are organized into a number of locations within the IC.
Each location can hold 1 bit, 4 bits, 8 bits, or even 16 bits, depending on how it is designed
internally.
1. A memory chip contains locations, where x is the number of address pins.
2. Each location contains y bits, where y is the number of data pins on the chip.
3. The entire chip will contain bits, where x is the number of address pins and y is the
number of data pins on the chip.
2. The CPU also has what is called the ALU (arithmetic/logic unit). The ALU section of the CPU
is responsible for performing arithmetic functions such as add, subtract, multiply, and divide, and
logic functions such as AND, OR, and NOT.
3. Every CPU has what is called a program counter. The function of the program counter is to
point to the address of the next instruction to be executed. As each instruction is executed, the
program counter is incremented to point to the address of the next instruction to be executed. The
contents of the program counter are placed on the address bus to find and fetch the desired
instruction. In the IBM PC, the program counter is a register called IP, or the instruction pointer.
4. The function of the instruction decoder is to interpret the instruction fetched into the CPU. One
can think of the instruction decoder as a kind of dictionary, storing the meaning of each
instruction and what steps the CPU should take upon receiving a given instruction. Just as a
dictionary requires more pages the more words it defines, a CPU capable of understanding more
instructions requires more transistors to design.
Computer Microprocessor Dr. Mohamed A. Torad 32
CPU ARCHITECTURE
Assume that an imaginary CPU has registers called A, B, C, and D. It has an 8-bit data bus and a
16-bit address bus. Therefore, the CPU can access memory from addresses 0000 to FFFFH (for a
total of 10000H locations). The action to be performed by the CPU is to put hexadecimal value
21 into register A, and then add to register A the values 42H and 12H. Assume that the code for
the CPU to move a value to register A is 1011 0000 (B0H) and the code for adding a value to
register A is 0000 0100 (04H).