Lecture Objectives Introduction to Computing Chapter The AVR microcontroller and embedded systems using assembly and c Students should be able to: Convert between base and. Explain the difference between a bit, a nibble, a byte and a word Give precise mathematical definitions of the terms kilobyte, megabyte, gigabyte and terabyte List and describe the purpose of the major components of a computer system Compare and contrast the different types of computer memory Describe the relationship between the number of memory locations on a chip, the number of data pins, and the chip memory capacity Describe the role of the in computer systems List the major components of the and describe the purpose of each List a describe the steps a follows in memory address decoding Understand the RISC and Harvard architectures Topics Numbering Systems Base and numbering systems and ASCII codes Internal organization of computers I/O Connecting the different parts Connecting memory to Connecting I/Os to How computers work Humans utilizes the base or decimal system in their everyday life while computers use the base or binary system. Decimal 8 9 Binary The binary system (base ) is used in computers because and represent the two voltage levels of on and off. Conversion example???
Numbering Systems Hexadecimal (base ) is used as a convenient representation of binary numbers. Its is much easier for humans to identify with 89H than b. Hexadecimal digit structure Converting between Binary and Hexadecimal Binary to Hex Group binary in groups of starting from the right Replace each -bit binary number with its hex equivalent. Example: Answer: Represent binary in hex. 9Fh or x9f How is it done?? Hex to Binary Replace each hex digit with its -bit binary equivalent. Hex 8 9 A B C D E F Dec 8 9 Example: Answer: Convert x9b to binary. b How is it done?? ASCII Codes ASCII Table All information in a computer system must be represented by s and s. As such binary patterns are assigned to letters and other characters. In the 9s a standard representation called ASCII (American Standard Code for Information Exchange) was established. Source: https://simple.wikipedia.org/wiki/ascii
Some Important Terminology Some Important Terminology A bit is a binary digit: that is can have the value or. A kilobyte is bytes, that is bytes. A byte is defined as 8 bits. A megabyte is bytes, that is,8, bytes. A nibble is half a byte, that is bits. A gigabyte is bytes. * A word is bytes A terabyte is bytes. Logic Gates Logic Levels
Internal Organization of Computers The internal organization of a computer is broken down into three parts: (Central Processing Unit) I/O (input/output) devices. Internal Organization of Computers The function of the is to execute (process) information stored in memory. Source: http://www.keystudy.com/microsys.htm The I/O devices, example keyboard, mouse, sensor, LCD, printer, hands of a robot, provide a means of communicating with the. Internal Organization of Computers Everything that can store, retain, and recall information. hard disk a piece of paper etc. The is connected to memory and I/O devices through strips of wire called a bus. There are three types of buses: address bus, data bus and control bus.
Characteristics Semiconductor Memories Capacity The number of bits that a memory can store. E.g. 8 Kbits, Mbits Organization How the locations are organized E.g. a 8 x memory has 8 locations, bits each Access time How long it takes to get data from memory 8 locations bits ROM Mask ROM PROM (Programmable ROM) EPROM (Erasable PROM) EEPROM (Electronic Erasable PROM) Flash EPROM RAM (Static RAM) SRAM (Dynamic RAM) DRAM Nonvolatile ) NV-RAM (RAM Semiconductor Memories Semiconductor Memories Mask ROM - Programmed by the IC manufacturer PROM - OTP (One-Time Programmable) User programed (only once) EEPROM Erased Electrically Erased instantly Each byte can be erased separately UV-EPROM Ultraviolet (UV) radiation is used to erase it Erasing takes up to minutes The entire contents of ROM are erased Flash ROM Erased in a Flash the entire device is erased at once
Semiconductor memories \RAM\SRAM (Static RAM) ROM Mask ROM PROM (Programmable ROM) EPROM (Erasable PROM) EEPROM (Electronic Erasable PROM) Flash EPROM RAM (Static RAM) SRAM (Dynamic RAM) DRAM Nonvolatile ) NV-RAM (RAM SRAM - Static RAM Made of flip-flops (Transistors) Advantages: Faster No need for refreshing Disadvantages: High power consumption Expensive K x 8 SRAM Semiconductor Memories Semiconductor Memories DRAM Dynamic RAM Made of capacitors NV-RAM Nonvolatile RAM Made of SRAM, Battery, control circuitry Advantages: Less power consumption Cheaper High capacity Advantages: Very fast Infinite program/erase cycle Non-volatile Disadvantages: Slower Refresh needed Disadvantage: Expensive
Central Processing Unit Connecting memory to Tasks: To execute instructions Call instructions one after another and execute them Pin Out A A Address Lines D D8 Data Lines Write Enable Output Enable Chip Select 8 n GND D-D A-A n- Connecting ing Writing from to memory to Connecting I/Os to Address Data Data should have lots of pins! Mouse Time Time Keyboard Network Graphic Card Sound Card
Connecting I/Os to using bus Connecting I/Os and to Write Write I/O I/O I/O I/O n 8 n I/O GND A-An- D-D I/O I/O I/O n Separate address and data lines for memory and I/O devices. Connecting I/Os and memory to using bus How could we manage it? GND A-An- D-D Connecting I/Os and to using bus (Peripheral I/O) Same address and data lines for memory and I/O devices. GND A-An- D-D.. Write Write IO/MEM I/O I/O I/O I/O n I/O I/O I/O I/O n 8
Connecting I/Os and to using bus ( Mapped I/O) Another example for address decoder How could we make the logic circuit? Solution Control. bus Write Write the address range in binary. Separate the fixed part of address. Using a NAND, design a logic circuit whose output activates when the fixed address is given to it. GND A-An- D-D.. Logic circuit The logic circuit enables when address is between and Design an address decoder for address of H to FFH. Solution. Write the address range in binary. Separate the fixed part of address. Design the logic circuit. From address H To address FFH a a a9 a8 a a a a a a a a a8 a9 a a a a a a a a a a From address I/O To address a I/O a I/O 8 I/O n a a An easy way of designing PC (Program Counter) Inside the Instruction decoder ALU (Arithmetic Logic Unit) Registers ALU PC Instruction decoder A B C D registers ALU Inst. Dec. PC: How computers work Write A B C D registers Logic circuit I/O I/O I/O 8 I/O n h Ch h 8h EAh h h A [] B A A [] A A+B [] A 9
How computers work h Ch h 8h EAh h A [] B A A [] A A+B [] A How computers work h Ch A [] h B A 8h A [] A A+B EAh [] A h h h Logic circuit Logic circuit ALU PC: Inst. Dec. Write A B C D registers 9 I/O I/O I/O 8 I/O n ALU PC: Inst. Dec. Write 9 A B C D registers I/O I/O I/O 8 I/O n How computers work h Ch h 8h EAh h h A [] B A A [] A A+B [] A Opcode How Instruction decoder works Operand Opcode Operand Instruction + E ALU Write E A 9 B PC: Inst. Dec. C D registers Eh Logic circuit I/O I/O I/O 8 I/O n h Ch h 8h EAh h h A [] B A A [] A A+B [] A Instruction Operation Code Meaning A x A [x] A A register (x) A A + x A A + register (x) A A x Register (x H ) Register (x L ) [x] A
Von Neumann vs. Harvard architecture Sources Code Von Neumann architecture Data http://f.tqn.com/y/pcsupport//w/k/e/-/-/intelxeon-e-.jpg http://www.physics-and-radioelectronics.com/computerbasics/images/computerblockdiagram.png https://cdn.sparkfun.com/assets//d////8 fdce9f9.png Code Data Harvard architecture