aLec06_LogicShift - Introduction to Embedded Microcomputer...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Introduction to Embedded Microcomputer Systems Lecture 6.1 Jonathan W. Valvano Required equipment (you will need to buy these) 1) You will need a voltmeter (any cheap one will do, spending $10 to $20 is sufficient) (myDAC), 2) A wire stripper for 22 or 24 gauge wire 3) Soldering iron and solder (if you have a friend with one, borrowing is OK) Recap 9S12 decomposes the execution into bus cycles Stack stores temp data and subroutine return address Subroutines provide a mechanism for modularity Parallel port, direction registers Overview Intro to C Logical operations Shift operations Arithmetic operations (introduction) What is C? ± C is a high-level language ² Abstracts hardware ² Expressive ² Readable ² Analyzable ± C is a procedural language ² The programmer explicitly specifies steps ² Program composed of procedures o Functions/subroutines ± C is compiled (not interpreted) ² Code is analyzed as a whole (not line by line) Why C? ± C is popular ± C influenced many languages ± C is considered close-to-machine ² Language of choice when careful coordination and control is required ² Straightforward behavior (typically) ± Typically used to program low-level software (with some assembly) ² Drivers, runtime systems, operating systems, schedulers, … How to program in C ± Preprocessor directives ± Variables and types ± Functions ² Subroutines and functions ± Statements ± Expressions ± Names ± Operators ± Comments ± Syntax 2.6. Logical operations A B A&B A|B A^B 0 0 0 0 0
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Introduction to Embedded Microcomputer Systems Lecture 6.2 Jonathan W. Valvano 0 1 0 1 1 1 0 0 1 1 1 1 1 1 0 Table 2.14. Logical operations. A B A&B AND Gate 74HC08 A B A|B OR Gate 74HC32 A B A^B EOR Gate 74HC86 A A NOT Gate 74HC04 Figure 2.12. implemented with discrete digital gates. A ~A 0 1 1 0 Table 3.11. Logical complement. anda #w ;RegA=RegA&w anda u ;RegA=RegA&[u] anda U ;RegA=RegA&[U] oraa #w ;RegA=RegA|w oraa u ;RegA=RegA|[u] oraa U ;RegA=RegA|[U] eora #w ;RegA=RegA^w eora u ;RegA=RegA^[u] eora U ;RegA=RegA^[U] coma ;RegA=~RegA The and operation to extract, or mask , individual bits Pressed = PTT&0x40; // true if the switch is pressed I n p u t p o r t μ C +5V 10k Ω 22 Ω 74HC14 5 μ F P T 6 q p I n p u t p o r t μ C + 5 V 1 0 k Ω P
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/28/2011 for the course EE 16345 taught by Professor Yerraballi during the Spring '11 term at University of Texas at Austin.

Page1 / 7

aLec06_LogicShift - Introduction to Embedded Microcomputer...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online