ECE 3561 - Lecture 1 1 Binary number system Department of Electrical and Computer Engineering The Ohio State University ECE 2560.

Slides:



Advertisements
Similar presentations
Code Composer Department of Electrical and Computer Engineering
Advertisements

Week 3. Assembly Language Programming  Difficult when starting assembly programming  Have to work at low level  Use processor instructions >Requires.
EET 1131 Unit 7 Arithmetic Operations and Circuits
Computer Organization and Assembly language
DIGITAL SYSTEMS TCE1111 Representation and Arithmetic Operations with Signed Numbers Week 6 and 7 (Lecture 1 of 2)
9/15/09 - L15 Decoders, Multiplexers Copyright Joanne DeGroat, ECE, OSU1 Binary additon & subtraction.
The MSP430xxxx Department of Electrical and Computer Engineering
The Texas Instruments MSP430
PIC microcontrollers. PIC microcontrollers come in a wide range of packages from small chips with only 8 pins and 512 words of memory all the way up to.
The M68HC11 Basic Instruction Set Basic Arithmetic Instructions
ECE 265 – LECTURE 12 The Hardware Interface 8/22/ ECE265.
Department of Electronic & Electrical Engineering Embedded system Aims: Introduction to: Hardware. Software Ideas for projects ? Robotics/Control/Sensors.
ES 244: Digital Logic Design Chapter 1 Chapter 1: Introduction Uchechukwu Ofoegbu Temple University.
Numbering systems.
ECE Lecture 1 1 Introduction to Microcontrolllers Department of Electrical and Computer Engineering The Ohio State University ECE 2560.
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 2 Number.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION.
SIGMA-DELTA ADC SD16_A Sigma-Delta ADC Shruthi Sujendra.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
1-1 Lecture 1 Class Overview and Appendix A -- Number Systems.
Chapter 2 Binary Values and Number Systems. 2 2 Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645,
Number systems, Operations, and Codes
Number Systems Binary to Decimal Octal to Decimal Hexadecimal to Decimal Binary to Octal Binary to Hexadecimal Two’s Complement.
Data Representation – Chapter 3 Section 3-1. Terminology “Digital” –Discrete, well defined values/steps –Opposite of analog –Analogy: digital is to analog.
ECE 456 Computer Architecture
Chapter 2 Introducing the PIC Mid-Range Family and the 16F84A The aims of this chapter are to introduce: The PIC mid-range family, in overview The overall.
WEEK #2 NUMBER SYSTEMS, OPERATION & CODES (PART 1)
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
CEC 220 Digital Circuit Design Binary Arithmetic & Negative Numbers Monday, January 13 CEC 220 Digital Circuit Design Slide 1 of 14.
MECH1500 Chapter 3.
School of Computer and Communication Engineering, UniMAP Mohd ridzuan mohd nor DKT 122/3 - DIGITAL SYSTEM I Chapter.
CEC 220 Digital Circuit Design Binary Arithmetic & Negative Numbers Fri, Aug 28 CEC 220 Digital Circuit Design Slide 1 of 14.
Introduction to Microprocessors - chapter3 1 Chapter 3 The 8085 Microprocessor Architecture.
Lab 3: ADC.
ECE 362 Microprocessor Systems and Interfacing ©5-1 Lecture 1 Hexadecimal Computation Outline n Decimal n Binary n Octal n Hexadecimal.
CPEN Digital Logic Design Binary Systems Spring 2004 C. Gerousis © Digital Design 3 rd Ed., Mano Prentice Hall.
EEE342 Digital Electronics Ian McCrumRoom 5B18, Lecture 2: Codes & Arithmetic.
Introduction to Digital Electronics Lecture 2: Number Systems.
CSC 331: DIGITAL LOGIC DESIGN COURSE LECTURER: E. Y. BAAGYERE. CONTACT: LECTURE TIME: 15:40 – 17:45 hrs. VENUE: SP-LAB.
The 8085 Microprocessor Architecture. What 8085 meant for? 80 - year of invention bit processor 5 - uses +5V for power.
Binary Addition and Subtraction. Arithmetic Operations Arithmetic operations in a computer are done using binary numbers and not decimal numbers and these.
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
Digital Logic & Design Adil Waheed Lecture 02.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
NUMBER SYSTEMS.
Digital Logic & Design Dr. Waseem Ikram Lecture 02.
Integer Real Numbers Character Boolean Memory Address CPU Data Types
Refer to Chapter 5 in the reference book
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
CHAPTER 1 : INTRODUCTION
Binary Arithmetic Binary arithmetic is essential in all digital computers and in many other types of digital systems. Addition, Subtraction, Multiplication,
Number Systems.
IT 0213: INTRODUCTION TO COMPUTER ARCHITECTURE
University of Gujrat Department of Computer Science
Chapter 1 Number Systems & Conversions
Principles & Applications
Decimal System The radix or base of a number system determines
MMNSS COLLEGE,KOTTIYAM DEPARTMENT OF PHYSICS
Final Exam Review Department of Electrical and Computer Engineering
Numbering System TODAY AND TOMORROW 11th Edition
Digital Logic & Design Lecture 02.
Introducing the PIC Mid-Range Family and the 16F84A
Digital Fundamentals Floyd Chapter 1 Tenth Edition
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
Number Systems Rayat Shikshan Sanstha’s
Binary to Decimal Conversion
Number Systems Rayat Shikshan Sanstha’s
CHAPTER 69 NUMBER SYSTEMS AND CODES
Presentation transcript:

ECE Lecture 1 1 Binary number system Department of Electrical and Computer Engineering The Ohio State University ECE 2560

ECE Lecture 1 2 Today Number systems To and from base 10 Addition Subtraction (made easy) Multiplication THIS LECTURE IS REVIEW MATERIAL

We live in a base 10 world Why base 10? Could have been base 5 or base 20. We can thank Ug! the caveman. In base 10 we have 10 symbols In any number base system you have n symbols Base 2 – 0 1 Base Base 16 – A B C D E F ECE Lecture 1 3

Other number bases Number system base Base 10 § § § § § § § § § § § § § Base 2 § § § § § § § § § § ECE Lecture 1 4

Base 5 and Base 8 Base 5 (would have digits 0 to 4) § § § § § § § § § § § § § Base 8 (octal) § § § § § § § § § § § § § ECE Lecture 1 5

To and from base Base 10 to binary (base 2) Number in Base = ? Procedure (Integer division) Divide by 2 19/2 = 9 r1 9/2 = 4 r 1 4/2 = 2 r 0 2/2 = 1 r 0 1/ 2 = 0 r 1 So the binary of is (In general for any number base you divide by the number system base and use the remainders) More examples? ECE Lecture 1 6

Another How about = ? Again divine by 2 each time So have More Examples? ECE Lecture 1 7

Base 2 to base 10 In first example have In binary the digits have the following weight Value 10 =a 4 *2 4 +a 3 *2 3 +a 2 *2 2 +a 1 *2 1 +a 0 *2 0 Value 10 =a 4 *16+a 3 *8+a 2 *4+a 1 *2+a 0 *1 So here = 1*16 +0*8 +0*4 +1*2 +1*1 = 19 ECE Lecture 1 8

2 nd example Had (written msb to lsb) Value of positions is (lsb to msb) 1,2,4,8,16,32,64,128,256,512,… The powers of 2 Value of the number above = = 139 ECE Lecture 1 9

Binary addition Follow the same rules as base 10 carries -> (7) (11) (18) More examples? ECE Lecture 1 10

Binary subtraction Set the problem And we need to borrow – step 1 ECE Lecture 1 11

Binary subraction The next steps work through to To allow answer to be done ECE Lecture 1 12

Binary multiplication Just like multiplication in base 10 More examples? ECE Lecture 1 13

2’s complement For 4 bits can represent values -8 to 7 In general can represent -2 n-1  n  2 n ECE Lecture 1 14

Arithmetic with 2’s complement Add 5 and -3 ECE Lecture 1 15

Finding the 2’s complement To generate the 2’s complement of n Say n is 3 3 in binary (4 bits) is 0011 Procedure 1) Take the 1’s complement, then add 1 1’s complement – complement all bits 0011  = ) Starting at the lsb (rightmost) bit Keep the 1 st 1 and then complement the rest of the bits. Can easily see on previous example. ECE Lecture 1 16

Subtraction via 2’s complement 14 – 6 (need 5 bits to represent in 2’s complement form) – or (i.e (-6)) and a carry out of 1 value is 8 ECE Lecture 1 17

Operating in 2’s complement In general can represent -2 n-1  n  2 n So with 4 bits can represent values of -8  n  +7 So with 8 bits can represent values of -128  n  +127 So with 16 bits can represent values of  n  ECE Lecture 1 18

A look at the MSP430 The chip – The MSP430F2003 ECE Lecture 1 19

The pins Vcc and Vss – Power and Ground being supplied to the chip. The data sheet specifies the tolerance on the voltage supply. P1.0-P1.7,P2.6,P2.7 are for digital input, grouped into 2 digital ports, P1 and P2 TACLK, TA0, TA1 are associated with the Timer_A. More details to come. ECE Lecture 1 20

The Pins (2) A0-, A0+ up to A4- and A4+ are inputs to the analog-to-digital converter. There are 4 channels and each has it own + and – input. Another pin, VREF is the reference voltage for the converter. ACLK and SMCLK are outputs of clock signals and can be used to supply external devices with a clock. XIN and XOUT are the connections for a crystal. RST’ – is the active low reset signal (could also be designated _RST or /RST) ECE Lecture 1 21

The Pins (3) NMI – the nonmaskable interrupt. Interrupts allow an external device to assert a value on this pin (a low) that causes the processor to halt operation after completion of the current instruction and ‘service’ the interrupt. When service is complete a software instruction allows resumption of normal operation. There are no maskable interrupts ECE Lecture 1 22

The Pins (4) TCK, TMS, TCLK, TD1, TD0 and TEST form the full JTAG interface used to program and debug the device. SBWTDIO and SBWTCK provide the Spy- By-Wire interface which is an alternative to JTAG and uses only the 2 pins. NOTE: each of the pins serves multiple purposes. The actual mode for each pin will vary across application and within a given application the use can be multiplexed. ECE Lecture 1 23

ECE Lecture 1 24 Assignment Read Chapter 1 and 2 READ FOR UNDERSTANDING Bring your questions to class Assignments will be due 2 classes after assigned to the drop box on Carmen. No paper submissions – all are electronic. Next time – the internal structure of the MSP 430 and start assembler coding Go to ti.com – order launchpad – get Code Composer Studio Quiz next Monday at start of class. Go to wikipedia.com and read on von Neuman architecture. Write a 1 page summary and submit to drop box, HW1