Lecture 7/12: Storing Numbers in Memory and Byte Ordering

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ก.ค. 2024
  • Prof. Harry Porter
    Portland State University
    cs.pdx.edu/~harry

ความคิดเห็น • 36

  • @tcmata11
    @tcmata11 9 ปีที่แล้ว +17

    Great videos. Drawn out figures make it much easier to comprehend. Learned more in these 15 minutes, than I have in 3 hours in my assembly language lecture

  • @bik8353
    @bik8353 6 ปีที่แล้ว +8

    Mr. Harry Potter does his magic once again. Thank you SO much

  • @COMB0RICO
    @COMB0RICO 6 ปีที่แล้ว

    Excellent teaching! Thanks from Texas.

  • @MulleDK19
    @MulleDK19 6 ปีที่แล้ว +3

    From a technical standpoint, little endian makes the most sense.
    It ensures that no matter the size of the value, the least significant byte, is always the same address. So eg. accessing a value as a short or a byte will access the same address, not having to offset.
    B = Big endian
    L = Little endian
    0 1 2 3
    B: 00 00 00 FF

  • @ilkimyagmurersem5541
    @ilkimyagmurersem5541 4 ปีที่แล้ว

    This helped tons! Thanks a lot for the clear explanations and nice examples!

  • @LeeHongYee99
    @LeeHongYee99 8 ปีที่แล้ว

    Very good lecture, more people should view.

  • @karthikbahaddurgattematha4651
    @karthikbahaddurgattematha4651 7 หลายเดือนก่อน

    I loved her... very good .... with a good example... thanks a lot

  • @TheDuckofDoom.
    @TheDuckofDoom. 7 ปีที่แล้ว +2

    Small definition-accuracy issue, the meaning and length of a "word" varies with the operating system, machine architecture, and programming language. Some use 2-bytes as the definition(and the bits per byte can depend on the machine, a few have used 9 or 12bit bytes over the years) others use the max atomic capacity of the CPU eg 64bits on a 64bit CPU. x86 assembly still uses 16bits due to the 16bit 8086 and 80286 origin of the x86[_64] instruction set.

    • @chuckdudley
      @chuckdudley 4 ปีที่แล้ว

      exactly - thank you

  • @roschoandrew5440
    @roschoandrew5440 5 ปีที่แล้ว

    Very good explanations there.

  • @lnsights
    @lnsights 7 ปีที่แล้ว

    nice lecture......easy to understand

  • @mehrdadkiani8476
    @mehrdadkiani8476 4 ปีที่แล้ว

    I wish I was one of your students, Professor Harry Porter.

  • @vineeshcv
    @vineeshcv 3 ปีที่แล้ว

    Thanks for the explanation, this is really good explanation about endianess

  • @blank336
    @blank336 6 ปีที่แล้ว

    Would be great if someone can clarify if I understood this least sig byte & most sig byte correctly;
    for example given in the video, 32-bit Integer value is 0x01234567 with big-endian being 01 23 45 67 and little-endian being 67 45 23 01. If the 32-bit Integer value happened to be 0x87654321 instead, would the big-endian be 87 65 43 21 and little-endian being 21 43 65 87? Thanks in advance.

  • @user-kl1yj1pc6z
    @user-kl1yj1pc6z 4 ปีที่แล้ว +2

    16:30 Why characters have a same output?
    ㅡㅡ
    I see now. Endian is matter about a data type like int, word etc, not a combination of data type. So a single char is endianness.

  • @laoying20
    @laoying20 4 ปีที่แล้ว

    Hello Prof. Harry Porter,
    good day
    thanks for your video. it helped me a lot.
    I want to know everything about computer Memory & CPU. can you please introduce me a book or any other resources?
    Appreciate a lot.

  • @guliyevshahriyar
    @guliyevshahriyar ปีที่แล้ว

    Thank you very much

  • @anondoggo
    @anondoggo 3 ปีที่แล้ว +1

    Sorry if I'm wrong, but I think in the examples, the addresses used to store the data are not aligned? (just wanted to check my concept, thank you!

  • @johntabor2619
    @johntabor2619 2 ปีที่แล้ว

    Thanks for sharing

  • @kingnehmna7810
    @kingnehmna7810 4 ปีที่แล้ว

    thank you

  • @catlord69
    @catlord69 5 ปีที่แล้ว

    pretty sure "sizeof" function is in standard library

    • @hhp3
      @hhp3  5 ปีที่แล้ว +3

      Actually, “sizeof” is built directly in to the C and C++ languages. It is a unary operator, like + and - . It is not a function, and it not included from a library. For example, you can say “sizeof buffer” although most programmers write “sizeof ( buffer )” instead. Note that you can’t leave off the parentheses for normal functions, so “foo ( buffer )” cannot be written as “foo buffer”.

  • @ShabaazShaikz
    @ShabaazShaikz 4 ปีที่แล้ว

    Good information

  • @billmichae
    @billmichae 2 ปีที่แล้ว

    Half Byte is a Nibble

  • @CR-um6bb
    @CR-um6bb 6 ปีที่แล้ว

    What is the 0x for??

    • @blank336
      @blank336 6 ปีที่แล้ว

      I believe its a C format for saying that its hexadecimal. Not sure if this definition is correct, just from an unstable memory of a dude that started learning :)

    • @giuseppeatanasio2926
      @giuseppeatanasio2926 6 ปีที่แล้ว +1

      0x means Hexadecimal. So, every character before the 0x is an hexadecimal number

  • @Waferdicing
    @Waferdicing ปีที่แล้ว

    💖

  • @billmichae
    @billmichae 2 ปีที่แล้ว

    Double Word is called LONG WORD

  • @yank3656
    @yank3656 4 ปีที่แล้ว

    thanks for sharing hhp3

  • @hadeseye2297
    @hadeseye2297 ปีที่แล้ว

    I can't agree with you on the word size. It's architecture dependant. For 8 bit cpus its width is 8 bits.
    Other than that, nice you use C. This way people can look into memory, rather than rely on runtime environment and words of the authors of books, or tutorials.

  • @Manoj_1102
    @Manoj_1102 6 ปีที่แล้ว +1

    Please correct it , Word contain 16 bits (2 Byte) while Dword contain 32 bits (4 byte) and so on...

  • @idafeoghene6984
    @idafeoghene6984 6 ปีที่แล้ว

    I thought a WORD is 16bits

    • @rickicalder9267
      @rickicalder9267 4 ปีที่แล้ว

      Correct according to Intel and most electrical engineering courses a Word is exactly 16 bits. cse.unl.edu/~goddard/Courses/CSCE351/IntelArchitecture/IntelDataType.pdf

    • @japhethobala3753
      @japhethobala3753 4 ปีที่แล้ว

      It depends with the architecture of the machine. The bit-iness of the cpu defines how many bits exists in a word this is because the CPU operates on a word. So a 16 bit machine has words of size 16 bits, a 32 bit machine has words of size 32 bits so on and so forth.

  • @AlqGo
    @AlqGo 7 ปีที่แล้ว

    &ip is a pointer to a pointer
    but it matters not for the purpose of your video