Texas Instruments Launchpad · Decimal Binary Octal Hex 00 0000 00 0 01 0001 01 1 02 0010 02 2 03...

19
                                           Texas  Instruments  Launchpad MCU: MSP430G2553 ROM 20 Pin ‐ Plastic Dual Inline Package (PDIP) ECE2560 Lesson01 Page_1 Lesson01 Page 1

Transcript of Texas Instruments Launchpad · Decimal Binary Octal Hex 00 0000 00 0 01 0001 01 1 02 0010 02 2 03...

Page 1: Texas Instruments Launchpad · Decimal Binary Octal Hex 00 0000 00 0 01 0001 01 1 02 0010 02 2 03 011 03 3 04 0100 04 4 05 0101 05 5 06 0110 06 6 07 0111 07 7 08 1000 10 8 09 1001

                                            Texas  Instruments  Launchpad

MCU: MSP430G2553

ROM

20 Pin ‐Plastic Dual In‐line Package (PDIP)

ECE2560 Lesson01 Page_1

Lesson01 Page 1

Page 2: Texas Instruments Launchpad · Decimal Binary Octal Hex 00 0000 00 0 01 0001 01 1 02 0010 02 2 03 011 03 3 04 0100 04 4 05 0101 05 5 06 0110 06 6 07 0111 07 7 08 1000 10 8 09 1001

InterpretationDigital signal is Hi or 1  if analog signal voltage  >  blue voltageDigital signal is Lo or 0  if analog signal voltage  < red voltage

Digital

Hi, 1

Lo, 0

Logical Valuesnot actual Voltages

Actual VoltagesAnalogAnalog  (voltage) Signal

VH

VL

Digital Signal

Mixed Signal Oscilloscope(MOS)

1 Bit (Binary Digit)

ECE2560 Lesson01 Page_2

Lesson01 Page 3

Page 3: Texas Instruments Launchpad · Decimal Binary Octal Hex 00 0000 00 0 01 0001 01 1 02 0010 02 2 03 011 03 3 04 0100 04 4 05 0101 05 5 06 0110 06 6 07 0111 07 7 08 1000 10 8 09 1001

ECE2560 Lesson01 Page_3

Lesson01 Page 4

Page 4: Texas Instruments Launchpad · Decimal Binary Octal Hex 00 0000 00 0 01 0001 01 1 02 0010 02 2 03 011 03 3 04 0100 04 4 05 0101 05 5 06 0110 06 6 07 0111 07 7 08 1000 10 8 09 1001

ECE2560 Lesson01 Page_4

Lesson01 Page 5

Page 5: Texas Instruments Launchpad · Decimal Binary Octal Hex 00 0000 00 0 01 0001 01 1 02 0010 02 2 03 011 03 3 04 0100 04 4 05 0101 05 5 06 0110 06 6 07 0111 07 7 08 1000 10 8 09 1001

ECE2560 Lesson01 Page_5

Lesson01 Page 6

Page 6: Texas Instruments Launchpad · Decimal Binary Octal Hex 00 0000 00 0 01 0001 01 1 02 0010 02 2 03 011 03 3 04 0100 04 4 05 0101 05 5 06 0110 06 6 07 0111 07 7 08 1000 10 8 09 1001

Decimal Binary Octal Hex

00 0000 00 0

01 0001 01 1

02 0010 02 2

03 011 03 3

04 0100 04 4

05 0101 05 5

06 0110 06 6

07 0111 07 7

08 1000 10 8

09 1001 11 9

10 1010 12 A

11 1011 13 B

12 1100 14 C

13 1101 15 D

14 1110 16 E

15 1111 17 F

Important table for converting bases among binary, octal and hexadecimal number representation

ECE2560 Lesson01 Page_6

Lesson01 Page 7

Page 7: Texas Instruments Launchpad · Decimal Binary Octal Hex 00 0000 00 0 01 0001 01 1 02 0010 02 2 03 011 03 3 04 0100 04 4 05 0101 05 5 06 0110 06 6 07 0111 07 7 08 1000 10 8 09 1001

ECE2560 Lesson01 Page_7

Lesson01 Page 8

Page 8: Texas Instruments Launchpad · Decimal Binary Octal Hex 00 0000 00 0 01 0001 01 1 02 0010 02 2 03 011 03 3 04 0100 04 4 05 0101 05 5 06 0110 06 6 07 0111 07 7 08 1000 10 8 09 1001

ECE2560 Lesson01 Page_8

Lesson01 Page 9

Page 9: Texas Instruments Launchpad · Decimal Binary Octal Hex 00 0000 00 0 01 0001 01 1 02 0010 02 2 03 011 03 3 04 0100 04 4 05 0101 05 5 06 0110 06 6 07 0111 07 7 08 1000 10 8 09 1001

ECE2560 Lesson01 Page_9

Lesson01 Page 10

Page 10: Texas Instruments Launchpad · Decimal Binary Octal Hex 00 0000 00 0 01 0001 01 1 02 0010 02 2 03 011 03 3 04 0100 04 4 05 0101 05 5 06 0110 06 6 07 0111 07 7 08 1000 10 8 09 1001

2n                     1 0 0 0 … 0 0 0 0

n bits

2n‐1                    1 1 1 … 1 1 1 1   

2n‐1                      1 0 0 … 0 0 0 0    

ECE2560 Lesson01 Page_10

Lesson01 Page 11

Page 11: Texas Instruments Launchpad · Decimal Binary Octal Hex 00 0000 00 0 01 0001 01 1 02 0010 02 2 03 011 03 3 04 0100 04 4 05 0101 05 5 06 0110 06 6 07 0111 07 7 08 1000 10 8 09 1001

ECE2560 Lesson01 Page_11

Lesson01 Page 12

Page 12: Texas Instruments Launchpad · Decimal Binary Octal Hex 00 0000 00 0 01 0001 01 1 02 0010 02 2 03 011 03 3 04 0100 04 4 05 0101 05 5 06 0110 06 6 07 0111 07 7 08 1000 10 8 09 1001

ECE2560 Lesson01 Page_12

Lesson01 Page 13

Page 13: Texas Instruments Launchpad · Decimal Binary Octal Hex 00 0000 00 0 01 0001 01 1 02 0010 02 2 03 011 03 3 04 0100 04 4 05 0101 05 5 06 0110 06 6 07 0111 07 7 08 1000 10 8 09 1001
Furrukh
Text Box
ECE2560 Lesson01 Page_13
Furrukh
Text Box
Furrukh
Text Box
Page 14: Texas Instruments Launchpad · Decimal Binary Octal Hex 00 0000 00 0 01 0001 01 1 02 0010 02 2 03 011 03 3 04 0100 04 4 05 0101 05 5 06 0110 06 6 07 0111 07 7 08 1000 10 8 09 1001
Furrukh
Text Box
ECE2560 Lesson01 Page_14
Page 15: Texas Instruments Launchpad · Decimal Binary Octal Hex 00 0000 00 0 01 0001 01 1 02 0010 02 2 03 011 03 3 04 0100 04 4 05 0101 05 5 06 0110 06 6 07 0111 07 7 08 1000 10 8 09 1001
Furrukh
Text Box
Furrukh
Text Box
ECE2560 Lesson01 Page_15
Page 16: Texas Instruments Launchpad · Decimal Binary Octal Hex 00 0000 00 0 01 0001 01 1 02 0010 02 2 03 011 03 3 04 0100 04 4 05 0101 05 5 06 0110 06 6 07 0111 07 7 08 1000 10 8 09 1001
Furrukh
Text Box
ECE2560 Lesson01 Page_16
Furrukh
Text Box
Furrukh
Pencil
Furrukh
Pencil
Furrukh
Pencil
Page 17: Texas Instruments Launchpad · Decimal Binary Octal Hex 00 0000 00 0 01 0001 01 1 02 0010 02 2 03 011 03 3 04 0100 04 4 05 0101 05 5 06 0110 06 6 07 0111 07 7 08 1000 10 8 09 1001

8 bits   2's compliment representation‐128 <= N <= 127

addition  10000001 = ‐127  10000001 = ‐127  ‐‐‐‐‐‐‐‐‐‐‐‐‐‐100000010  = 2  overflow!!

(2's compliment of  10000001 is 01111111 = 127therefore 10000001 = ‐127)

     11000001     = ‐63  + 11000001    =  ‐63                     ‐63+(‐63) = ‐126      ‐‐‐‐‐‐‐‐‐‐‐‐‐‐   110000010 =  ‐126 no overflow!!

(2's compliment of 10000010 is 01111110 = 126therefore 10000010 =  ‐126)Carry out of signed bit position not equal to                        Carry into signed bit position

   10     10000001 = ‐127  + 10000001 = ‐127  ‐‐‐‐‐‐‐‐‐‐‐‐‐‐   100000010  = 2  overflow!!

Discard

Addition overflow in 2's compliment representation

ECE2560 Lesson01 Page_17

Lesson01 Page 14

Page 18: Texas Instruments Launchpad · Decimal Binary Octal Hex 00 0000 00 0 01 0001 01 1 02 0010 02 2 03 011 03 3 04 0100 04 4 05 0101 05 5 06 0110 06 6 07 0111 07 7 08 1000 10 8 09 1001

Carry out of signed bit position is equal to                        Carry into signed bit position

   11     11000001 = ‐63  + 11000001 = ‐63  ‐‐‐‐‐‐‐‐‐‐‐‐‐‐   110000010  = ‐126  no overflow!!

For addition (in 2's compliment representation),

Overflow can only happen if both numbers have the same sign•

There is overflow if carry out of the signed bit position is not equal to carry into the signed bit position

Discard

ECE2560 Lesson01 Page_18

Lesson01 Page 16

Page 19: Texas Instruments Launchpad · Decimal Binary Octal Hex 00 0000 00 0 01 0001 01 1 02 0010 02 2 03 011 03 3 04 0100 04 4 05 0101 05 5 06 0110 06 6 07 0111 07 7 08 1000 10 8 09 1001
Furrukh
Text Box
ECE2560 Lesson01 Page_19
Furrukh
Text Box
V = 1 - overflow V = 0 - no overflow