Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
URGENT! SDC computer architecture project : part 4
#5
@Bobbym This is NOT a waste of time. If you ever do DSP stuff on MCUs it actually makes a lot of sense. When you start doing bit twidderly in C or C++ you'll need to understand what's happening. When you look at the disassembly view in Keil or IAR then this knowledge is FUNDAMENTAL.

Okay as per your assignment, look at the machine architecture, that will determine if the machine is using Little Endian or Big Endian storage type in the register.

The key of the program is to perform a bitwise shift operation depending on the register storage operation, and depending on the endianess, that will determine if you do a left or right bitwise shift.

Remember if you keep shifting what happens to the bits? if it's using two's complement format, what digit is used to maintain it being signed or unsigned. If you're wondering how you will get all 1's there is your clue.

Also regardless of which number you started with you can do your shifts to get all zeros.

As for if the register is all ones, what is all ones in decimal? if it's 8 bits in 2's complement representation format?. How can you check that in assembly?

If you did the course its actually pretty easy, it's been a few years for me, but this stuff is used in industry all the time.

Oh and remember the assembly mnemonics structuring will match the processor architecture of your design.




@holmes what crap are you saying? OMG.

If you shift the contents of a full register it WILL get to a 0 in the LSB if you do a shift. Remember left shift does "blank" and right shift does "blank" operations (hint * and /).

If the 8 bit register word size is 255 bits, and you try to insert a greater value than it can hold then a register OVERFLOW will occur when the register is given a value more than it can hold and it will start from 0 again.

Let's say you have an 8-bit MCU (PIC, AVR, STM8 etc) and you keep shifting bits what will happen?

Here is a 4 bit counter done on the Arduino as an example:

https://www.youtube.com/watch?v=08fTlrFOLFU

Its a 4 bit register, what happens when you keep shifting bits? It returns to 0. Remember 0 in an 8-bit register is 00000000.

Ever work with C or C++? When happens if you have an int and you try to store a larger value than the storage size? It wraps around.

See this is why this course is so important. If you get a job as an embedded software engineer this is FUNDAMENTAL knowledge. Play around with a microcontroller, program in C or C++ and see what happens.

THIS COURSE IS NOT A WASTE OF TIME IT IS IMPORTANT. Maybe you just don't work in a field where its important to YOU. But for understanding things like ECC, CRC etc and writing solid programs its invaluable.

Even if you decide to do web or mobile, unless you plan to do nothing but front end development or UI this stuff IS important. At some point you'll have to optimize something and you can't use "var" you must do an explicit type declaration like "int" and if you don't know this then you'll have a hell of a time when a player's points reaches to zero after they cross a certain value.

Its so prevalent and part of bugs it's part of the C standard library <stdlib.h>

Look at

int8_t
int16_t
int32_t

etc...

@Bobbym This stuff is what will set you apart from the dime a dozen code monkey's when you go into the field. This bit stuff is so important a BIBLE for anyone working with hardware and even hacker's is this book "Hacker's Delight" that handles a lot of bit twiddlery here:

https://www.amazon.com/Hackers-Delight-2...0321842685


Here's also a free page that people refer to all the time for bit twiddling:
https://graphics.stanford.edu/~seander/bithacks.html
GRADUATE

PhD Information and Communication Technology (UK IET Accredited) (On Hold)

Universidad Isabel I, Spain
Masters in Business Artificial Intelligence 2024-2025

BA Computer Science, TESU  '19
BA Liberal Studies, TESU  '19
AS  Natural Science and Mathematics, TESU  '19

StraighterLine (27 Cr)   Shmoop (18 Cr)  Sophia (11 Cr)
TEEX (5 Cr) Aleks (9 Cr)  ED4Credit (3 Cr) CPCU (2 Cr)   Study.com (39 Cr)

TESU (4 cr)
B&M (46 Cr)  Nations University  (9 cr)  UoPeople: (3 cr) Penn Foster: (8 cr)  

[-] The following 1 user Likes armstrongsubero's post:
  • LevelUP
Reply


Messages In This Thread
RE: URGENT! SDC computer architecture project : part 4 - by armstrongsubero - 12-26-2021, 02:07 PM

Possibly Related Threads...
Thread Author Replies Views Last Post
  2026 Saylor CS302 Software Engineering and CS402 Computer Communications and Networks animuscerebri 0 57 8 hours ago
Last Post: animuscerebri
Information New Sophia Course - Computer Applications (1 Credit LL) Ares 2 682 12-01-2025, 10:27 PM
Last Post: LevelUP
  Westcott Adding RA Computer Science Courses Jonathan Whatley 9 2,757 09-22-2025, 09:29 AM
Last Post: bluebooger
  New Study.com Courses Intro to Web Development, Intro to Project Managment Jonathan Whatley 3 1,412 07-06-2025, 11:35 AM
Last Post: jsh1138
  I plan to apply for a master's degree in Computer Science in the US Thermor1993 3 1,769 11-27-2024, 03:24 PM
Last Post: Tomas
  SDC CS306 Computer architecture experience hsufeng 9 3,747 08-07-2024, 02:48 AM
Last Post: legenwait4itdary
  TESU BA Computer Science - SDC credits newdegree 4 2,077 07-15-2024, 12:12 PM
Last Post: bjcheung77
Thumbs Up IBM certificates now part of Coursera Plus Pikachu 4 4,098 06-05-2024, 08:30 PM
Last Post: bjcheung77
  SDC: Computer Science 105: Introduction to Operating Systems legenwait4itdary 12 3,591 05-29-2024, 12:16 AM
Last Post: legenwait4itdary
Question Speedrunning SDC Data Structures and Computer Architecture advice? Randyb100 15 4,228 04-09-2024, 06:36 PM
Last Post: bjcheung77

Forum Jump:


Users browsing this thread: 1 Guest(s)