Newbie Question - Info Please


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Sep 2006
    Posts
    10


    Did you find this post helpful? Yes | No

    Default

    ErnieM. That's terrific. What a great summary!
    So at the end when you mention you can do importing into MPLABS to get a pretty good picture of the machine code, the machine code I presume is the binary 1's and 0's? I always thought the HEX code was a hexadecimal notation version of the binary info the machine runs on. NO? I must be missing something then? After all the HEX code gets transferred to the chip memory but is that not the binary program the machine runs on?

  2. #2
    Join Date
    Jul 2005
    Posts
    78


    Did you find this post helpful? Yes | No

    Default

    [quote]I always thought the HEX code was a hexadecimal notation version of the binary info the machine runs on. NO? I must be missing something then? After all the HEX code gets transferred to the chip memory but is that not the binary program the machine runs on?[quote]

    YES! They are two ways of saying the same thing.

    HEX notation is usefull to humans who don't read binary very efficiently, but can read HEX fairly well. HEX numbers and binary numbers have a 1 to 1 corrospondance, so they are two ways of saying the same thing.

    HEX can only express binary digits 4 bits at a time, so one hex represents 4 binary digits, 2 hex digits represent 8 binary digits, and so on

    The only exception to this is PIC instructions are 14 bits long, so they need a 4 digit hex number to represent them; 4 hex digits is 4x4=16 bits for 2 extra bits at the top end, so any instruction in hex will never be larger then 7FFF

    (The actual largest instruction is 7EFF, which is ADDLW H'FF', or add literal to W. The instruction set actually gives the 7th bit as a don't care (1 or 0), but also says 0 is prefered there, and that is what the compiler will give.) (I know cause I just tried it.)

Similar Threads

  1. Newbie 74hc595 question
    By manjero in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 22nd January 2008, 23:22
  2. newbie with serial com question...
    By kevlar129bp in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 16th December 2006, 06:34
  3. Greetings from Newbie and a question
    By ChrisHelvey in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 24th July 2006, 16:52
  4. Newbie question
    By senojlr in forum General
    Replies: 7
    Last Post: - 11th April 2006, 22:23
  5. Replies: 4
    Last Post: - 8th September 2005, 16:42

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts