Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. What is a 'byte'?

What is a 'byte'?

Scheduled Pinned Locked Moved C / C++ / MFC
question
16 Posts 10 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U User 1990498

    Ok. Thanks. Is it possible to compress 8bits into a byte using RLC( Run-Length Coding)?

    N Offline
    N Offline
    Nish Nishant
    wrote on last edited by
    #4

    You don't need to compress anything there - a byte is 8 bits.

    U 1 Reply Last reply
    0
    • N Nish Nishant

      You don't need to compress anything there - a byte is 8 bits.

      U Offline
      U Offline
      User 1990498
      wrote on last edited by
      #5

      Does that means I am actually shrinking the size of the data?

      N 1 Reply Last reply
      0
      • U User 1990498

        Does that means I am actually shrinking the size of the data?

        N Offline
        N Offline
        Nish Nishant
        wrote on last edited by
        #6

        sclh wrote: Does that means I am actually shrinking the size of the data? Nope. When you have an 8-bit binary number - that's a byte. Exmaples of bytes are 10010010, 10001000, 11111111, 0 (00000000), 10000001 etc. The decimal equivalent of the largest unsigned byte is 255. So if you have a byte variable, it can represent any of 256 values (0 included).

        U 1 Reply Last reply
        0
        • N Nish Nishant

          sclh wrote: Does that means I am actually shrinking the size of the data? Nope. When you have an 8-bit binary number - that's a byte. Exmaples of bytes are 10010010, 10001000, 11111111, 0 (00000000), 10000001 etc. The decimal equivalent of the largest unsigned byte is 255. So if you have a byte variable, it can represent any of 256 values (0 included).

          U Offline
          U Offline
          User 1990498
          wrote on last edited by
          #7

          Ok, thank you for the info. Perhaps I will go and read up and find out my problem then I will consult help again.Thanks.

          1 Reply Last reply
          0
          • U User 1990498

            Hi, can someone tell me what is a byte? how many bits does 1 byte equals to?

            V Offline
            V Offline
            V 0
            wrote on last edited by
            #8

            the word byte comes from By Eight. Meaning they took eight bits together :-) No hurries, no worries.

            M 1 Reply Last reply
            0
            • V V 0

              the word byte comes from By Eight. Meaning they took eight bits together :-) No hurries, no worries.

              M Offline
              M Offline
              markkuk
              wrote on last edited by
              #9

              No, it comes from the word "bite", but with changed spelling. Originally bytes could be 1-6 bits in length. http://en.wikipedia.org/wiki/Byte[^] http://www.catb.org/~esr/jargon/html/B/byte.html[^]

              V 1 Reply Last reply
              0
              • M markkuk

                No, it comes from the word "bite", but with changed spelling. Originally bytes could be 1-6 bits in length. http://en.wikipedia.org/wiki/Byte[^] http://www.catb.org/~esr/jargon/html/B/byte.html[^]

                V Offline
                V Offline
                V 0
                wrote on last edited by
                #10

                ok I stand corrected. No hurries, no worries.

                N 1 Reply Last reply
                0
                • C Cedric Moonen

                  A byte is equal to 8 bits. It has the same size as a character.

                  D Offline
                  D Offline
                  David Crow
                  wrote on last edited by
                  #11

                  cedric moonen wrote: A byte is equal to 8 bits. Only for UTF-8. You could also have UTF-16 which would be a 16-bit byte (e.g., Unicode).


                  "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

                  R 1 Reply Last reply
                  0
                  • V V 0

                    ok I stand corrected. No hurries, no worries.

                    N Offline
                    N Offline
                    NormDroid
                    wrote on last edited by
                    #12

                    you almost had me convinced ;P Blogless

                    B 1 Reply Last reply
                    0
                    • D David Crow

                      cedric moonen wrote: A byte is equal to 8 bits. Only for UTF-8. You could also have UTF-16 which would be a 16-bit byte (e.g., Unicode).


                      "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

                      R Offline
                      R Offline
                      Ravi Bhavnani
                      wrote on last edited by
                      #13

                      AFAIK, a byte is always 8-bits. [edit] I just saw the reference to the article that said there used to be 6-bit bytes, but today's byte is 8-bits in length. [/edit] I believe UTF-16 uses a 16-bit (i.e. 2 byte) "word". Hence, MBCS, DBCS, etc. refer to multi-byte, double-byte..., etc. /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

                      D 1 Reply Last reply
                      0
                      • R Ravi Bhavnani

                        AFAIK, a byte is always 8-bits. [edit] I just saw the reference to the article that said there used to be 6-bit bytes, but today's byte is 8-bits in length. [/edit] I believe UTF-16 uses a 16-bit (i.e. 2 byte) "word". Hence, MBCS, DBCS, etc. refer to multi-byte, double-byte..., etc. /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

                        D Offline
                        D Offline
                        David Crow
                        wrote on last edited by
                        #14

                        Fair enough. I rarely deal with such things, so I was just mainly throwing it out on the table for further discussion.


                        "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

                        1 Reply Last reply
                        0
                        • N NormDroid

                          you almost had me convinced ;P Blogless

                          B Offline
                          B Offline
                          Blake Miller
                          wrote on last edited by
                          #15

                          And here I thought is was a contraction from the Old English - 'Byte Me!'

                          1 Reply Last reply
                          0
                          • U User 1990498

                            Ok. Thanks. Is it possible to compress 8bits into a byte using RLC( Run-Length Coding)?

                            J Offline
                            J Offline
                            John M Drescher
                            wrote on last edited by
                            #16

                            No, to compress with rle you need at minimum 4 bytes (32 bits). I assume you read the article at http://www.arturocampos.com/ac_rle.html[^] about RLE. I also believe it explains rle compression pretty well. Do you have any specific questions about the article or rle? Is your problem homework or for some other purpose? I ask this because rle is definitly not the best algorithm to use. And there are several source code compression libraries that you can download and use for free. John

                            1 Reply Last reply
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • World
                            • Users
                            • Groups