Digital Logic Design Alex Bronstein

Slides:



Advertisements
Similar presentations
INPUT-OUTPUT ORGANIZATION
Advertisements

Input and Output CS 215 Lecture #20.
Serial I/O - Programmable Communication Interface
CS-334: Computer Architecture
Hierarchy of I/O Control Devices
7-1 Digital Serial Input/Output Two basic approaches  Synchronous shared common clock signal all devices synchronised with the shared clock signal data.
Interface circuits I/O interface consists of the circuitry required to connect an I/O device to a computer bus. Side of the interface which connects to.
Unit-5 CO-MPI autonomous
INPUT-OUTPUT ORGANIZATION
Input/Output. Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower.
Chapter 10: Input / Output Devices Dr Mohamed Menacer Taibah University
Input and Output Computer Organization and Assembly Language: Module 9.
Lecture 20: Communications Lecturers: Professor John Devlin Mr Robert Ross.
2007 Oct 18SYSC2001* - Dept. Systems and Computer Engineering, Carleton University Fall SYSC2001-Ch7.ppt 1 Chapter 7 Input/Output 7.1 External Devices.
Universal Asynchronous Receiver/Transmitter (UART)
Input/Output 2 What is I/O? How we get the CPU to communicate with devices From the computer’s point of view, it’s just 1’s and 0’s Gets interpreted.
2009 Sep 10SYSC Dept. Systems and Computer Engineering, Carleton University F09. SYSC2001-Ch7.ppt 1 Chapter 7 Input/Output 7.1 External Devices 7.2.
Universal Asynchronous Receiver/Transmitter (UART)
Organisasi Sistem Komputer Materi VIII (Input Output)
Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower than CPU.
IT3002 Computer Architecture
Networked Embedded Systems Pengyu Zhang EE107 Spring 2016 Lecture 8 Serial Buses.
Computer Organization and Architecture + Networks Lecture 6 Input/Output.
Computer System Structures
Chip Config & Drivers – Required Drivers:
Serial Communications
Department of Computer Science and Engineering
Chapter 6 Input/Output Organization
Serial mode of data transfer
I/O SYSTEMS MANAGEMENT Krishna Kumar Ahirwar ( )
Computer System Structures
EE 107 Fall 2017 Lecture 5 Serial Buses – UART & SPI
Part VI Input/Output and Interfacing
Operating Systems (CS 340 D)
Computer buses Adam Hoover connecting stuff together
Serial I/O and Data Communication.
1 Input-Output Organization Computer Organization Computer Architectures Lab Peripheral Devices Input-Output Interface Asynchronous Data Transfer Modes.
May 2006 Saeid Nooshabadi ELEC2041 Microprocessors and Interfacing Lectures 29: I/O Interfacing Examples
EE 107 Fall 2017 Lecture 7 Serial Buses – I2C Direct Memory Access
CS 286 Computer Organization and Architecture
E3165 DIGITAL ELECTRONIC SYSTEM
CS703 - Advanced Operating Systems
Atmega32 Serial Programming Basics
Computer Architecture
DIGITAL DATA COMMUNICATION TECHNIQUES
Computer Organization and Design
BIC 10503: COMPUTER ARCHITECTURE
Introduction to Microprocessors and Microcontrollers
Interfacing Memory Interfacing.
DIGITAL DATA COMMUNICATION TECHNIQUES
Asynchronous Serial Communications
Serial Communication Interface: Using 8251
UART Protocol Chapter 11 Sepehr Naimi
DIGITAL DATA COMMUNICATION TECHNIQUES
Created by Vivi Sahfitri
Programmable Data Communication Blocks
CHAPTER SERIAL PORT PROGRAMMING. Basics of Serial Communication Computers transfer data in two ways: ◦ Parallel  Often 8 or more lines (wire.
Serial Communication 19th Han Seung Uk.
1.2.1 Data transmission.
Chapter 13: I/O Systems.
Microprocessor I 7/18/2019.
Serial Communications
Introduction Communication Modes Transmission Modes
Presentation transcript:

Digital Logic Design 234262 Alex Bronstein Lecture 10: I/O and Communication

Abstraction Hierarchy Application Software Operating System (threads, files, exceptions) Computer Architecture (instruction set) Micro-Architecture (execution pipeline) Logic (adders, multipliers, FSMs) Digital Circuits (gates) Analog Circuits (amplifiers) Process and Devices (MOS FET transistors) Physics (electrons, holes, tunneling, band gap)

Input/Output interrupts CPU Cache Memory-I/O interconnect RAM I/O ctl Graphics output Network Storage

Memory-mapped I/O Certain memory addresses are mapped to device registers Writing to such address sends data to external device SW can poll device register to check for event More efficiently: device can generate interrupt when event happens Some device registers can be read- only Memory Device

Console I/O in MIPS Receiver control (0xFFFF0000) Receiver data (0xFFFF0004) Transmitter control (0xFFFF0008) Transmitter data (0xFFFF000C) 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 IE RD 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 RECEIVED BYTE 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 IE RD 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 TRANSMITTED BYTE

Direct keyboard input Receiver = keyboard Receiver control register: Ready bit (0): asserted when unread input from keyboard Interrupt enable bit (1): keyboard input generates interrupt Receiver data register: contains last pressed key in lowest byte Reading data register resets ready bit Read by polling: li $t0, 0xffff0000 rd_poll: lw $v0, 0($t0) andi $v0, $v0, 0x01 #key pressed? beq $v0, $zero, rd_poll #wait if not lw $v0, 4($t0) #last key in $v0

Direct character display Transmitted = display Transmitter control register: Ready bit (0): asserted when display accepting new character Interrupt enable bit (1): display ready generates interrupt Transmitter data register: contains last displayed character Writing data register resets ready bit Write by polling: # character to print in $a0 li $t0, 0xffff0008 wr_poll: lw $v0, 0($t0) andi $v0, $v0, 0x01 #display ready? beq $v0, $zero, wr_poll #wait if not sw $a0, 4($t0) #display character

Parallel vs Serial Parallel Serial 1 D0 D1 D2 D3 D4 D5 D6 D7 D0 D1 D2 1 D0 D1 D2 D3 D4 D5 D6 D7 D0 D1 D2 D3 D4 D5 D6 D7 D0 D1 D2 D3 D4 D5 D6 D7 0 1 1 0 0 0 1 0 DO DI TX RX TX RX

Parallel vs Serial Serial: one bit is conveyed at a time over communication link Small ICs: SPI, I2C Newer peripheral buses: PCIe, USB, SATA, FireWire Network: Ethernet, Infiniband, Fibre channel Good old serial port (RS-232) Parallel: multiple bits are sent simultaneously over the link Buses inside the chip Memory interfaces Older peripheral buses: ISA, ATA, SCSI, PCI Parallel printer port

Parallel Pros Higher data rate at lower clock speed Simple hardware: only one register is required on each side to send/receive data on the bus Cons Clock skew between channels reduces link speed Reduced cable length Increased cable/connector cost

Serial Pros Clock skew is not an issue (for unclocked async links) Simple connectors and cables Extra space allows better isolation from environment Longer cables Can be clocked faster Cons Requires data serialization/deserialization

Universal Asynchronous Receiver/Transmitter Individual or part of a bigger IC used for serial communications Underlying physical layer may differ (RS-232 port, USB, Bluetooth) Communication can be Simplex: unidirectional Full duplex: both devices send and receive at the same time Half duplex: devices take turns in sending/receiving No clock signal is exchanged between Tx and Rx Requires agreement in advance between Tx and Rx on communication parameters (bps, number of data bits, stop bits, parity) Serialization/deserialization via shift registers

Shift register: serial in parallel out Optional output buffer D Q D Q D Q D Q Serial In SHIFT CLK

Shift register: parallel in serial out D0 D1 D2 D3 Optional input buffer D Q D Q D Q D Q Serial Out WR/SHIFT CLK

UART data frame Line is held high (telegraph legacy) START STOP D0 D1 D2 D3 D4 D5 D6 D7 PRTY Line is held high (telegraph legacy) Frame starts with start bit (“0”) Followed by data bits (6-8) Followed by optional parity bit for error detection Even parity: (data, parity) always has an even number of 1’s Odd parity: (data, parity) always has an odd number of 1’s Fixed at either 0 or 1 Followed by stop bits (1, 1.5 or 2 at “1”)

UART Rx Since no clock is transmitted, Rx has to recover it from the data stream Done by oversampling (typically x16): each serial bit is sampled 16 times (but only one bit is saved) Rx sequence: Wait until input becomes 0 (start bit) and reset sampling counter When counter reaches 7 (middle of start bit) restart counter Wait until counter reaches 15 (middle of D0). Shift it into register and restart counter Repeat 3 for remaining data bits (Repeat 3 for parity bit) Repeat 3 for stop bits

UART Rx/Tx Rx Shift register Output buffer rdata Baud rate generator control Rx empty ready received Status rx_status /16 Tx control Tx empty finished send Status tx_status Tx Shift register Output buffer wdata

UART protocol Sender waits until finished is high Sender writes 8 bits to wdata and asserts send to initiate transmission. Tx interface automatically resets finished Tx interface serializes the data and sends them over the link Tx interface raises finish when done (this can generate HW interrupt) Sender party writes next 8 bits… Rx interface samples link channel and deserializes data Rx interface fills output buffer and raises ready Receiver waits until ready is high and reads rdata. Receiver raises received to acknowledge end of reception. Rx interface automatically resets ready Rx interface deserializes next frame…

UART rdata wdata ready RX TX send received finished wdata rdata send 8 8 rdata wdata ready RX TX send received finished 8 8 wdata rdata send TX RX ready finished received Transmitting and receiving parties have different clock domains Asynchronous communication between clock domains