분류 전체보기 58

명령어(Instruction)에 대해 알아보자

1. 명령어(Instruction)란 무엇인가?1.1 명령어의 정의명령어(Instruction)는 프로그래머가 작성한 소프트웨어의 특정 동작이나 작업들을 CPU(중앙처리장치)가 직접 이해하고 실행할 수 있도록 지시하기 위해 약속된 기계어 또는 프로그래밍언어를 뜻한다. 기계적으로 명령어는 오직 0과 1로만 이루어진 이진 코드(기계어, Machine Code)의 비트 패킷 형태를 띠며, 인간이 식별하기 위해 ADD, SUB, JMP 같은 어셈블리어 기호(Mnemonic)로 일대일 매핑하여 표현한다. 1.2 명령어의 구조명령어는 CPU에게 "어떤 행동을 하라"고 내리는 한 줄의 비트 패킷이다. 이 패킷은 논리적으로 크게 두 가지 구역으로 쪼개질 수 있다. 옵코드 (Opcode - Operation Code)뜻..

CS 2026.06.01

ISA(Instruction Set Architecture, 명령어 집합 구조)란 무엇일까?

ISA(명령어 집합 구조)는 소프트웨어 개발 영역(컴파일러, 어셈블러)과 하드웨어 설계 영역(마이크로아키텍처, 물리 회로 등)이 만나는 인터페이스이자 명세서(Specification)라 할 수 있다. 쉽게 말해 하드웨어(CPU)와 소프트웨어(프로그램) 사이의 약속 체계이자 번역기이다. ISA는 다음과 같은 것을 보장하도록 명시되어 있다.아키텍처 레지스터 값=> 소프트웨어가 직접 읽고 쓸 수 있도록 ISA가 정의한 레지스터들(x86의 rax, rbx, rsp 등 - 명령어 비트 패킷 안에 rax = 000, rbx = 011, 이런 방식으로 인코딩 후 소프트웨어가 CPU에게 어떤 레지스터인지 전달하는 수단이다. )의 값( 해당 레지스터에 실제로 들어있는 데이터). ISA 아키텍처에서 몇번 슬롯의 레지스터..

CS 2026.06.01

[leetCode] 98. Validate Binary Search Tree

https://leetcode.com/problems/validate-binary-search-tree/description/ Validate Binary Search Tree - LeetCodeCan you solve this real interview question? Validate Binary Search Tree - Given the root of a binary tree, determine if it is a valid binary search tree (BST). A valid BST is defined as follows: * The left subtree of a node contains only nodes with keys sleetcode.com 해당 문제의 조건은 이진트리에서 왼쪽 ..

[leetCode] 105. Construct Binary Tree from Preorder and Inorder Traversal

https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/description/ Construct Binary Tree from Preorder and Inorder Traversal - LeetCodeCan you solve this real interview question? Construct Binary Tree from Preorder and Inorder Traversal - Given two integer arrays preorder and inorder where preorder is the preorder traversal of a binary tree and inorder is the in..

[leetCode] 230. Kth Smallest Element in a BST

https://leetcode.com/problems/kth-smallest-element-in-a-bst/description/ Kth Smallest Element in a BST - LeetCodeCan you solve this real interview question? Kth Smallest Element in a BST - Given the root of a binary search tree, and an integer k, return the kth smallest value (1-indexed) of all the values of the nodes in the tree. Example 1: [https://assets.leetcoleetcode.com k번째 작은 노드 수를 구하는 ..

[leetCode] 572. Subtree of Another Tree

https://leetcode.com/problems/subtree-of-another-tree/description/ Subtree of Another Tree - LeetCodeCan you solve this real interview question? Subtree of Another Tree - Given the roots of two binary trees root and subRoot, return true if there is a subtree of root with the same structure and node values of subRoot and false otherwise. A subtree of a binleetcode.com 메인트리와 서브트리로 두 이진트리가 주어졌을 때, ..

[leetCode] 79. Word Search

https://leetcode.com/problems/word-search/description/ Word Search - LeetCodeCan you solve this real interview question? Word Search - Given an m x n grid of characters board and a string word, return true if word exists in the grid. The word can be constructed from letters of sequentially adjacent cells, where adjacent cells are hleetcode.com이 문제는 2차원 배열 내에서의 탐색 문제이다.여기서 하나의 문자열이 주어지는데, 이 문자열을 ..

[leetCode] 3417. Zigzag Grid Traversal With Skip

https://leetcode.com/problems/zigzag-grid-traversal-with-skip/description/ Zigzag Grid Traversal With Skip - LeetCodeCan you solve this real interview question? Zigzag Grid Traversal With Skip - You are given an m x n 2D array grid of positive integers. Your task is to traverse grid in a zigzag pattern while skipping every alternate cell. Zigzag pattern traversal is defileetcode.com 그냥 지그재그로 이중 ..