Logic Circuits and Signals Hardware/Software Connection Corrado - - PowerPoint PPT Presentation

logic circuits and signals hardware software connection
SMART_READER_LITE
LIVE PREVIEW

Logic Circuits and Signals Hardware/Software Connection Corrado - - PowerPoint PPT Presentation

Logic Circuits and Signals Hardware/Software Connection Corrado Santoro ARSLAB - Autonomous and Robotic Systems Laboratory Dipartimento di Matematica e Informatica - Universit` a di Catania, Italy santoro@dmi.unict.it L.S.M. Course Corrado


slide-1
SLIDE 1

Logic Circuits and Signals Hardware/Software Connection

Corrado Santoro

ARSLAB - Autonomous and Robotic Systems Laboratory Dipartimento di Matematica e Informatica - Universit` a di Catania, Italy santoro@dmi.unict.it L.S.M. Course

Corrado Santoro Logic Circuits and Signals

slide-2
SLIDE 2

Logic Circuits Logic Circuits

Corrado Santoro Logic Circuits and Signals

slide-3
SLIDE 3

Basics of Logic Circuits

Logic circuits are characterized by the fact that voltage of wires can assume only two values:

0 V, corresponding to Logic/bit-value “0” +VDD, corresponding to Logic/bit-value “1”

where VDD is the power supply of the whole circuit, it may be 5 V, 3.3 V, 1.8 V

Corrado Santoro Logic Circuits and Signals

slide-4
SLIDE 4

Logic Circuits Classification

Combinatorial Circuits They are logic circuits where the output is dependent only

  • n the current state of the inputs

Logic gates (AND, OR, NOT, etc.) are kind of combinatorial circuits Their behaviour is represented by a truth table

AND OR NOT NOR NAND XNOR XOR Corrado Santoro Logic Circuits and Signals

slide-5
SLIDE 5

Special Combinatorial Circuits

Multiplexers Multiplexers are combinatorial circuits that act as signal switches One data input at time is routed to the output on the basis

  • f the values of control input bits

MUX ... 2^n data inputs n bits control inputs

  • ut

4-to-1 MUX

0 0

4-to-1 MUX

0 1

4-to-1 MUX

1 0

4-to-1 MUX

1 1 Corrado Santoro Logic Circuits and Signals

slide-6
SLIDE 6

Logic Circuits Classification

Sequential Circuits They are logic circuits where the output is dependent only

  • n the current and past state of the inputs

They are sensible to variations of the inputs They are logic circuits that have a memory Flip-Flops and their derivatives are kind of combinatorial circuits Their behaviour is represented by a finite-state machine In general, a clock signal drives their behaviour

Corrado Santoro Logic Circuits and Signals

slide-7
SLIDE 7

Logic Circuits Classification

Kind of Sequential Circuits

Flip-flops Counters Registers

D Q Q

D-Type

J K Q Q

JK-Type

S R Q Q

SR-Latch

S R Q Q

SR-Synchr-Latch Counter n-bits

  • verflow

Register n-bits-out

write

n-bits-in Corrado Santoro Logic Circuits and Signals

slide-8
SLIDE 8

Logic Signals Logic Signals

Corrado Santoro Logic Circuits and Signals

slide-9
SLIDE 9

Logic Signals

Constant Signals They are logic states that does not vary in time Variable Signals They are logic states that may vary in time They are featured by edges

Falling Edge: variation from “1” to “0” Rising Edge: variation from “0” to “1”

time VDD time VDD time VDD

Constant "0" Constant "1" Variable Signal Falling Edge Rising Edge

Corrado Santoro Logic Circuits and Signals

slide-10
SLIDE 10

Logic Signals

Edges and Sequential Circuits Sequential Circuits are sensible to edges Edge inputs are represented in circuits by “triangles” simple triangle: rising edge circle + triangle: falling edge

State change on rising edge State change on falling edge

Corrado Santoro Logic Circuits and Signals

slide-11
SLIDE 11

Logic Signals

Periodic Signals They are kind of variable signals where the time distance between two edges of the same time is constant This distance is called Period, P and measured in seconds The frequency, computed as f = 1

P , is the number of

“periods” per second and is measured in Hertz, Hz

time VDD

Periodic Signal

Period Period

Corrado Santoro Logic Circuits and Signals

slide-12
SLIDE 12

Logic Signals

Periodic Signals

Periodic signals can be:

symmetric: the time durations of state “0” and state “1” is the same and equal to T0 = T1 = P

2

asymmetric: the time durations of state “0” and state “1” is different T0 = T1

The “asymmetry” is called duty cycle and is the percentage of period in which the signal is “1” DC = T1 T0 + T1 100 = T1 P 100

time VDD

Symmetric Signal

T0 T1

time VDD

Asymmetric Signal

T1 T0 Period

Corrado Santoro Logic Circuits and Signals

slide-13
SLIDE 13

Time and Frequency Measures

Time Measures

milliseconds: 1 ms = 10−3 s microseconds: 1 µs = 10−6 s nanoseconds: 1 ns = 10−9 s picoseconds: 1 ps = 10−12 s

Frequency Measures

KiloHertz: 1 KHz = 103 Hz MegaHertz: 1 MHz = 106 Hz GigaHertz: 1 GHz = 109 Hz TeraHertz: 1 THz = 1012 Hz

Corrado Santoro Logic Circuits and Signals

slide-14
SLIDE 14

Hardware/Software Connection Hardware/Software Connection

Corrado Santoro Logic Circuits and Signals

slide-15
SLIDE 15

Hardware/Software Connection

Hardware/Software Connection Circuits of a MCU are “connected” to the software through registers/counters A register is mapped in memory at a known memory address Hardware/software interaction is performed by reading/writing at that memory address

Corrado Santoro Logic Circuits and Signals

slide-16
SLIDE 16

Hardware/Software Connection

An Example: Piece Counter A “presence sensor” generates a pulse each time a “piece” is identified The pulse is connected to an external counter MCU input Each time the sensor generates a pulse, the counter increments (in hardware)

32-bit counter @ mem 0x80c000 Data bus

External Count Input RD WR

Control Bus

Corrado Santoro Logic Circuits and Signals

slide-17
SLIDE 17

Hardware/Software Connection

32-bit counter @ mem 0x80c000 Data bus

External Count Input RD WR

Control Bus

Reading/Writing the Counter

... int32_t * counter_prt = (int32_t *)0x80c000; ... /* clearing the counter */ *counter_ptr = 0; ... /* printing the counter */ printf("Counter value %d\n", *counter_ptr);

✡ ✝ ✆

Corrado Santoro Logic Circuits and Signals

slide-18
SLIDE 18

Hardware/Software Connection

32-bit counter @ mem 0x80c000 Data bus

External Count Input RD WR

Control Bus

2-to-1

Internal Oscillator

32-bit config register @ mem 0x80c004 Data bus

RD WR

Control Bus Bit 6

Configuring the Counter

int32_t * config_prt = (int32_t *)0x80c004; /* counter input from Internal Oscillator */ *config_ptr = 0; /* counter input from External Counter Input */ *config_ptr = 0x40;

✡ ✝ ✆

Corrado Santoro Logic Circuits and Signals

slide-19
SLIDE 19

Logic Circuits and Signals Hardware/Software Connection

Corrado Santoro

ARSLAB - Autonomous and Robotic Systems Laboratory Dipartimento di Matematica e Informatica - Universit` a di Catania, Italy santoro@dmi.unict.it L.S.M. Course

Corrado Santoro Logic Circuits and Signals