Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Logic, Bytes and Hexadecimal

  • 10-11-2009 07:31PM
    #1
    Registered Users, Registered Users 2 Posts: 7,994 ✭✭✭


    Hi Folks,

    I've read up a fair bit on this but I must be missing something. I'm looking at a page of data from a 512 bit memory. This memory is divided into 16 pages with 4 bytes in each.

    Now, each of these 4 bytes has 8 bits. So eight 1's and 0's I presume which represent a logic state.

    However, when I read one of these pages I get a hex string:
    9E 48 F0 00 FF FF FF FF E5 F3 E5 32 01 A9 41 02
    

    So would I be right in saying "01 A9 41 02" represents one byte so 8 bits?

    And how do I read the logic state of each bit?

    :confused:

    Many Thanks!


Comments

  • Registered Users, Registered Users 2 Posts: 1,922 ✭✭✭ronivek


    There's plenty out there to help you here; the first Google result for "digital number system" for example.

    Effectively you're not getting the representation of data in a digital system. At it's lowest level you're representing data as binary; i.e. a sequence of 1s and 0s.

    Four binary digits are equivalent to a single hexadecimal value; 1-F (1,2,3,4,5,6,7,8,9,A,B,C,D,E,F).

    So if you have five hexadecimal digits; they're represented by (5 * 4) = 20 binary digits.

    The example you've posted; "01 A9 41 02"; is therefore equivalent to 32-bits.
    And how do I read the logic state of each bit?

    Well; a single hex digit maps onto four binary digits and each binary digit is equivalent to a true or false value. For example F is equivalent to 1111, 3 is equivalent to 0011 etc. Assembly/most languages have bitwise operators which allow you to shift bits left and right; or the use a mask to determine if a specific value is set. Some languages will allow you to test whether a specific bit within a register/value is set or not.


  • Registered Users, Registered Users 2 Posts: 7,994 ✭✭✭ironclaw


    ronivek wrote: »
    There's plenty out there to help you here; the first Google result for "digital number system" for example.

    Effectively you're not getting the representation of data in a digital system. At it's lowest level you're representing data as binary; i.e. a sequence of 1s and 0s.

    Four binary digits are equivalent to a single hexadecimal value; 1-F (1,2,3,4,5,6,7,8,9,A,B,C,D,E,F).

    So if you have five hexadecimal digits; they're represented by (5 * 4) = 20 binary digits.

    The example you've posted; "01 A9 41 02"; is therefore equivalent to 32-bits.

    Ok, that makes sense. Thanks for that. But would that not mean I have too many bits? The memory only holds 512 bits, which if spread over 16 pages, means there is a maximum of 32 bits per page. But if that string above has 128bits how does that work?

    For reference, the devices I'm doing the project work with: http://www.nxp.com/acrobat/other/identification/M028634_MF0ICU1_Functional_Spec_V3.4.pdf


  • Registered Users, Registered Users 2 Posts: 1,922 ✭✭✭ronivek


    According to the specifications the READ command returns 4 full pages from a given starting address; 4 full pages being 128 bits which is equivalent to the data you have in your post.


  • Registered Users, Registered Users 2 Posts: 7,994 ✭✭✭ironclaw


    I actually noticed that last night. I was commanding a 4 byte read. I misread the command as a 4 bit read, so in essence I was taking four full pages instead of 4 areas of the one page. My mistake entirely.

    Thanks for all the help!


Advertisement