Verilog notes

  • code within begin/end blocks are executed sequentially
  • all begin/end blocks are executed in parallel
  • ‘=’ blocks and ‘<=’ is non-blocking

JavaScript notes

  • Variables declared with var are permanent: attempting to delete them with the delete operator causes an error.
  • Variables declared without var are implicitly declared as global variables, even if you’re inside the body of a function.
  • It’s best to use var all the time–regardless of whether it’s local or global.
  • There is no block scope; all variables declared within a function are defined throughout the function.
  • It doesn’t matter when a variable is declared within it’s scope. Even if it’s defined 10 lines down from the current statement, you have access to it (although it is undefined).
  • Use for in when you need access to the keys of an associative array.
  • Use for each in when you need access to the values of an associative array.

Segmentation Faults vs. Bus Errors

Seg faults are raised when:

  • Programs attempt to access a memory location that it doesn’t have permission to access.
  • Programs attempt to access memory in a way that is not allowed (e.g., writing to read-only).

Bus errors occur when:

  • A non-existent physical memory access attempt is encountered. A non-existent virtual memory access attempt will cause a segfault.
  • An unaligned memory address is encountered.